]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-apt-mark
try to avoid removal of crossgraded packages
[apt.git] / test / integration / test-apt-mark
index 9b68945f98735bb2460284373e1dc77fc9c6da08..7a115b03ffec11b0f5408e6aa192536ec2a3c138 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 setupenvironment
 configarchitecture 'amd64' 'i386'
 
@@ -20,7 +20,7 @@ testdpkginstalled dpkg
 
 testnoautopkg() {
        testempty aptmark showauto
-       testempty aptcache showauto
+       testempty aptcache -q=1 showauto
        testsuccessequal 'bar
 dpkg
 foo' aptmark showmanual
@@ -29,22 +29,22 @@ foo' aptmark showmanual bar foo uninstalled
 }
 testfooisauto() {
        testsuccessequal 'foo' aptmark showauto
-       testsuccessequal 'foo' aptcache showauto
+       testsuccessequal 'foo' aptcache -q=1 showauto
        testsuccessequal 'foo' aptmark showauto foo
-       testsuccessequal 'foo' aptcache showauto foo
+       testsuccessequal 'foo' aptcache -q=1 showauto foo
        testsuccessequal 'bar
 dpkg' aptmark showmanual
        testsuccessequal 'bar' aptmark showmanual bar
 }
 testmarkonpkgasauto() {
-       testsuccess $1 $2 foo
+       testsuccess $1 -q=1 $2 foo
        testfooisauto
-       testsuccess $1 $2 foo
+       testsuccess $1 -q=1 $2 foo
        testfooisauto
 
-       testsuccess $1 $3 foo
+       testsuccess $1 -q=1 $3 foo
        testnoautopkg
-       testsuccess $1 $3 foo
+       testsuccess $1 -q=1 $3 foo
        testnoautopkg
 }
 
@@ -99,3 +99,56 @@ testmarkonepkgashold 'uninstalled-native'
 
 testsuccessequal 'uninstalled set on hold.' aptmark hold uninstalled
 testsuccessequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native
+#FIXME: holds on uninstalled packages are not persistent in dpkg
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following NEW packages will be installed:
+  uninstalled uninstalled-native
+The following held packages will be changed:
+  uninstalled-native
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst uninstalled (1 unstable [all])
+Inst uninstalled-native (1 unstable [amd64])
+Conf uninstalled (1 unstable [all])
+Conf uninstalled-native (1 unstable [amd64])' aptget install uninstalled uninstalled-native -s
+testsuccess aptmark unhold uninstalled uninstalled-native
+
+testselections() {
+       testsuccess aptmark hold "$1"
+       testsuccessequal "$1" aptmark showholds "$1"
+       testsuccess aptmark unhold "$1"
+       testsuccessequal "$1" aptmark showinstalls "$1"
+       testsuccess aptmark hold "$1"
+       testsuccessequal "$1" aptmark showholds "$1"
+       testsuccess aptmark install "$1"
+       testsuccessequal "$1" aptmark showinstalls "$1"
+       testsuccess aptmark remove "$1"
+       testsuccessequal "$1" aptmark showremoves "$1"
+       testsuccess aptmark purge "$1"
+       testsuccessequal "$1" aptmark showpurges "$1"
+}
+testselections 'foo'
+testselections 'bar'
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+  bar* foo*
+0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
+Purg bar [1]
+Purg foo [1]' aptget dselect-upgrade -s
+
+testuninstalledselections() {
+       testsuccess aptmark hold "$1"
+       testsuccessequal "$1" aptmark showholds "$1"
+       testsuccess aptmark unhold "$1"
+       testsuccessequal "$1" aptmark showremoves "$1"
+       testsuccess aptmark hold "$1"
+       testsuccessequal "$1" aptmark showholds "$1"
+       testsuccess aptmark install "$1"
+       testsuccessequal "$1" aptmark showinstalls "$1"
+}
+testuninstalledselections 'uninstalled'
+testuninstalledselections 'uninstalled-native'