]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-autoremove
adapt to the new CacheSetHelper API
[apt.git] / test / integration / test-apt-get-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
14testsuccess aptget install unrelated debhelper -y
15testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
16
17testmarkedauto 'po-debconf'
18testsuccess aptget remove debhelper -y
19testdpkgnotinstalled 'debhelper'
20testdpkginstalled 'po-debconf' 'unrelated'
21
22echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
23testequal 'Reading package lists...
24Building dependency tree...
25Reading state information...
26The following packages will be REMOVED:
27 po-debconf
280 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
29Remv po-debconf [1.0.16]' aptget autoremove -s
30testdpkginstalled 'po-debconf'
31
32echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
33testsuccess aptget autoremove -y
34testdpkginstalled 'po-debconf'
35
36echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
37testsuccess aptget autoremove -y
38testdpkginstalled "po-debconf"
39
40rm rootdir/etc/apt/apt.conf.d/00autoremove
41testsuccess aptget autoremove -y
42testdpkgnotinstalled 'po-debconf'
43testmarkedauto
44
45sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e 's#), #)\nInstall: #g' | sort -u > apt-history.log
46testfileequal 'apt-history.log' '
47Install: debhelper:i386 (8.0.0)
48Install: po-debconf:i386 (1.0.16, automatic)
49Install: unrelated:i386 (1)
50Remove: debhelper:i386 (8.0.0)
51Remove: po-debconf:i386 (1.0.16)'
52
53testsuccess aptget install debhelper -y
54testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
55testsuccess aptmark auto debhelper
56
57testmarkedauto 'debhelper' 'po-debconf'
58testequal 'Reading package lists...
59Building dependency tree...
60Reading state information...
61The following packages will be REMOVED:
62 debhelper po-debconf
630 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
64Remv debhelper [8.0.0]
65Remv po-debconf [1.0.16]' aptget autoremove -s
66
67testsuccess aptmark hold debhelper
68testequal 'Reading package lists...
69Building dependency tree...
70Reading state information...
710 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s