]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-get-autoremove
use apt-mark instead of hand-mangling with the extended_states file
[apt.git] / test / integration / test-apt-get-autoremove
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386'
8
9 buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
10 buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
11 buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
12 setupaptarchive
13
14 aptget install unrelated debhelper -qq 2>&1 > /dev/null
15 testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
16
17 testmarkedauto 'po-debconf'
18 aptget remove debhelper -y -qq 2>&1 > /dev/null
19 testdpkgnotinstalled 'debhelper'
20 testdpkginstalled 'po-debconf' 'unrelated'
21
22 echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
23 testequal 'Reading package lists...
24 Building dependency tree...
25 Reading state information...
26 The following packages will be REMOVED:
27 po-debconf
28 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
29 Remv po-debconf [1.0.16]' aptget autoremove -s
30 testdpkginstalled 'po-debconf'
31
32 echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
33 aptget autoremove -y -qq 2>&1 > /dev/null
34 testdpkginstalled 'po-debconf'
35
36 echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
37 aptget autoremove -y -qq 2>&1 > /dev/null
38 testdpkginstalled "po-debconf"
39
40 rm rootdir/etc/apt/apt.conf.d/00autoremove
41 aptget autoremove -y -qq 2>&1 > /dev/null
42 testdpkgnotinstalled 'po-debconf'
43 testmarkedauto
44
45 sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
46 testfileequal 'rootdir/var/log/apt/history.log' '
47 Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic)
48
49 Remove: debhelper:i386 (8.0.0)
50
51 Remove: po-debconf:i386 (1.0.16)'