testaptgetupdate() {
rm -rf rootdir/var/lib/apt
- aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
+ aptget update >testaptgetupdate.diff 2>&1 || true
sed -i -e '/Ign /,+1d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
GIVEN="$1"
shift
}
testoverfile() {
+ local APTARCHIVE="$(readlink -f ./aptarchive)"
forcecompressor "$1"
createemptyfile 'en'
testaptgetupdate 'Reading package lists...' "empty archive Packages.$COMPRESS over file"
createemptyfile 'Packages'
- testaptgetupdate "Err file: Packages
+ testaptgetupdate "Err file:$APTARCHIVE Packages
Empty files can't be valid archives
-W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS) Empty files can't be valid archives
+W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives
E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over file"
}
testoverhttp() {
forcecompressor "$1"
- createemptyfile 'en'
- testaptgetupdate "Get: http://localhost:8080 Packages []
-Get: http://localhost:8080 Translation-en
-Reading package lists..." "empty file en.$COMPRESS over http"
-
- createemptyarchive 'en'
- testaptgetupdate "Get: http://localhost:8080 Packages []
-Get: http://localhost:8080 Translation-en []
-Reading package lists..." "empty archive en.$COMPRESS over http"
-
createemptyarchive 'Packages'
testaptgetupdate "Get: http://localhost:8080 Packages []
Reading package lists..." "empty archive Packages.$COMPRESS over http"