X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/eb76e936982bd65ebd6a147c1c23ef2613891367..61db48241f2d46697a291bfedaf398a1ca9a70e3:/test/integration/test-bug-611729-mark-as-manual diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index 9c1cd3d1b..97ef846e3 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture "i386" @@ -15,91 +15,82 @@ buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b" setupaptarchive # dpkg freaks out if the last package is removed so keep one around -aptget install peace-dpkg -y -qq 2>&1 > /dev/null +testsuccess aptget install peace-dpkg -y testdpkginstalled peace-dpkg -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b testdpkgnotinstalled c -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'b' -aptget remove a -y -qq 2>&1 > /dev/null +testsuccess aptget remove a -y testdpkgnotinstalled a c testdpkginstalled b -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'b' -aptget install c -y -qq 2>&1 > /dev/null +testsuccess aptget install c -y testdpkgnotinstalled a testdpkginstalled b c -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'b' -testequal 'Reading package lists... +testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'b' -testequal 'Reading package lists... +testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'b' -aptget install b --reinstall -y -qq 2>&1 > /dev/null +rm rootdir/var/log/apt/history.log + +testsuccess aptget install b --reinstall -y testdpkgnotinstalled a testdpkginstalled b c -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 1 -' - -testequal 'Reading package lists... +testmarkedauto 'b' + +sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' +if [ -n "$SUDO_USER" ]; then + testfileequal 'rootdir/var/log/apt/history.log' " +Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) +Reinstall: b:i386 (1.0)" +else + testfileequal 'rootdir/var/log/apt/history.log' ' +Reinstall: b:i386 (1.0)' +fi + +testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). b set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: b -Architecture: i386 -Auto-Installed: 0 -' +testmarkedauto -aptget remove b -y -qq 2>&1 > /dev/null +testsuccess aptget remove b -y testdpkgnotinstalled a b c -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto -aptget install a b -y -qq 2>&1 > /dev/null +testsuccess aptget install a b -y testdpkginstalled a b testdpkgnotinstalled c -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto -aptget purge a b -y -qq 2>&1 > /dev/null +testsuccess aptget purge a b -y testdpkgnotinstalled a b c -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto -aptget install b c -y -qq 2>&1 > /dev/null +testsuccess aptget install b c -y testdpkgnotinstalled a testdpkginstalled b c -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b c -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testmarkedauto