]> git.saurik.com Git - apt.git/commitdiff
check that the right amount of packages is installed if multiple passed in
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 3 Feb 2011 22:25:41 +0000 (23:25 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 3 Feb 2011 22:25:41 +0000 (23:25 +0100)
test/integration/framework
test/integration/test-autoremove

index e79d312ca2eefb86014a1d2a1785f98dc2102f2c..3aa80db23048eafac2c9ba76919a0c37b02bee6b 100644 (file)
@@ -623,8 +623,8 @@ testnopackage() {
 
 testdpkginstalled() {
        msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
-       local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)"
-       if [ "$PKGS" != 0 ]; then
+       local PKGS="$(dpkg -l $* | grep '^i' | wc -l)"
+       if [ "$PKGS" != $# ]; then
                echo $PKGS
                dpkg -l $* | grep '^[a-z]'
                msgfail
@@ -635,7 +635,7 @@ testdpkginstalled() {
 
 testdpkgnotinstalled() {
        msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
-       local PKGS="$(dpkg -l $* 2> /dev/null | grep '^[a-z]' | grep '^[^u]' | wc -l)"
+       local PKGS="$(dpkg -l $* 2> /dev/null | grep '^i' | wc -l)"
        if [ "$PKGS" != 0 ]; then
                echo
                dpkg -l $* | grep '^[a-z]'
index f1ce4e9e75e47c2e05d893f6e97272793b8c05ab..9dfab19f56c91427816aef320e33854cc7ac8b1a 100755 (executable)
@@ -20,7 +20,7 @@ Auto-Installed: 1
 '
 aptget remove debhelper -y -qq 2>&1 > /dev/null
 testdpkgnotinstalled 'debhelper'
-testdpkginstalled 'po-debconf unrelated'
+testdpkginstalled 'po-debconf' 'unrelated'
 
 echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
 testequal 'Reading package lists...