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