]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-pdiff-usage
add support for apt-get build-dep unpacked-source-dir
[apt.git] / test / integration / test-pdiff-usage
index 5a06e0ccbffe7c2923b6eaf29aef7483540af561..afe1ad443d2e4d09a0b1ffa4ebe64cc7b084173d 100755 (executable)
@@ -20,10 +20,29 @@ chmod +x extrred
 echo 'Dir::Bin::rred "./extrred";' > rootdir/etc/apt/apt.conf.d/99rred
 
 wasmergeused() {
-       testsuccess aptget update "$@"
+       msgtest 'Test for successful execution of' "$*"
+       local OUTPUT=$(mktemp)
+       addtrap "rm $OUTPUT;"
+       if aptget update "$@" >${OUTPUT} 2>&1; then
+               msgpass
+       else
+               echo
+               cat $OUTPUT
+               msgfail
+       fi
+
+       msgtest 'No intermediate patch files' 'still exist'
+       local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')"
+       if [ -z "$EDS" ]; then
+               msgpass
+       else
+               echo
+               echo "$EDS"
+               msgfail
+       fi
+
        msgtest 'Check if the right pdiff merger was used'
-       if [ -e ./merge-was-used ]; then
-               rm -f ./merge-was-used
+       if grep -q '^pkgAcqIndexMergeDiffs::Done(): rred' $OUTPUT; then
                if echo "$*" | grep -q -- '-o Acquire::PDiffs::Merge=1'; then
                        msgpass
                else
@@ -37,7 +56,7 @@ wasmergeused() {
 }
 
 testrun() {
-       # setup the base
+       msgmsg "Testcase: setup the base with: $*"
        find aptarchive -name 'Packages*' -type f -delete
        cp ${PKGFILE} aptarchive/Packages
        compressfile 'aptarchive/Packages'
@@ -50,7 +69,7 @@ testrun() {
        testequal "$(cat ${PKGFILE})
 " aptcache show apt oldstuff
 
-       # apply with one patch
+       msgmsg "Testcase: apply with one patch: $*"
        cp ${PKGFILE}-new aptarchive/Packages
        compressfile 'aptarchive/Packages'
        mkdir -p aptarchive/Packages.diff
@@ -73,13 +92,13 @@ SHA1-Patches:
        testequal "$(cat ${PKGFILE}-new)
 " aptcache show apt newstuff
 
-       # index is already up-to-date
+       msgmsg "Testcase: index is already up-to-date: $*"
        find rootdir/var/lib/apt/lists -name '*.IndexDiff' -type f -delete
        testsuccess aptget update "$@"
        testequal "$(cat ${PKGFILE}-new)
 " aptcache show apt newstuff
 
-       # apply with two patches
+       msgmsg "Testcase: apply with two patches: $*"
        cp ${PKGFILE}-new aptarchive/Packages
        echo '
 Package: futurestuff
@@ -120,7 +139,7 @@ SHA1-Patches:
        testequal "$(cat Packages-future)
 " aptcache show apt newstuff futurestuff
 
-       # patch applying fails, but successful fallback
+       msgmsg "Testcase: patch applying fails, but successful fallback: $*"
        rm -rf rootdir/var/lib/apt/lists
        cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
        cp ${PKGFILE}-new aptarchive/Packages
@@ -145,6 +164,10 @@ SHA1-Patches:
        testequal "$(cat ${PKGFILE}-new)
 " aptcache show apt newstuff
 }
+echo 'Debug::pkgAcquire::Diffs "true";
+Debug::pkgAcquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf
 
-testrun -o Debug::pkgAcquire::Diffs=1 -o Debug::pkgAcquire::rred=1 -o Acquire::PDiffs::Merge=0
-testrun -o Debug::pkgAcquire::Diffs=1 -o Debug::pkgAcquire::rred=1 -o Acquire::PDiffs::Merge=1
+testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1
+testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1
+testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0
+testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0