]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-bug-595691-empty-and-broken-archive-files
deal better with acquiring the same URI multiple times
[apt.git] / test / integration / test-bug-595691-empty-and-broken-archive-files
index fedf82c92f283cea89ec25ae6b07d188d000d5ff..b42212f5ea32f9f70c9457fbe7ce68c0a6e537bc 100755 (executable)
@@ -12,7 +12,7 @@ setupflataptarchive
 
 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
@@ -49,6 +49,7 @@ createemptyfile() {
 }
 
 testoverfile() {
+       local APTARCHIVE="$(readlink -f ./aptarchive)"
        forcecompressor "$1"
 
        createemptyfile 'en'
@@ -63,9 +64,9 @@ testoverfile() {
        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"
 }
@@ -73,16 +74,6 @@ E: Some index files failed to download. They have been ignored, or old ones used
 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"