]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-get-autoremove
ignore for _apt inaccessible TMPDIR in pkgAcqChangelog
[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 testsuccess aptget install unrelated debhelper -y
15 testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
16
17 testmarkedauto 'po-debconf'
18 testsuccess aptget remove debhelper -y
19 testdpkgnotinstalled 'debhelper'
20 testdpkginstalled 'po-debconf' 'unrelated'
21
22 echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
23 testsuccessequal '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 testequal "Reading package lists...
31 Building dependency tree...
32 Reading state information...
33 The following package was automatically installed and is no longer required:
34 po-debconf
35 Use 'apt-get autoremove' to remove it.
36 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
37 testequal "Reading package lists...
38 Building dependency tree...
39 Reading state information...
40 1 package was automatically installed and is no longer required.
41 Use 'apt-get autoremove' to remove it.
42 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
43 testdpkginstalled 'po-debconf'
44
45 echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
46 testsuccess aptget autoremove -y
47 testdpkginstalled 'po-debconf'
48
49 echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
50 testsuccess aptget autoremove -y
51 testdpkginstalled "po-debconf"
52
53 rm rootdir/etc/apt/apt.conf.d/00autoremove
54 testsuccess aptget autoremove -y
55 testdpkgnotinstalled 'po-debconf'
56 testmarkedauto
57
58 sed 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
59 testfileequal 'apt-history.log' '
60 Install: debhelper:i386 (8.0.0)
61 Install: po-debconf:i386 (1.0.16, automatic)
62 Install: unrelated:i386 (1)
63 Remove: debhelper:i386 (8.0.0)
64 Remove: po-debconf:i386 (1.0.16)'
65
66 testsuccess aptget install debhelper -y
67 testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
68 testsuccess aptmark auto debhelper
69
70 testmarkedauto 'debhelper' 'po-debconf'
71 testsuccessequal 'Reading package lists...
72 Building dependency tree...
73 Reading state information...
74 The following packages will be REMOVED:
75 debhelper po-debconf
76 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
77 Remv debhelper [8.0.0]
78 Remv po-debconf [1.0.16]' aptget autoremove -s
79 testequal "Reading package lists...
80 Building dependency tree...
81 Reading state information...
82 The following packages were automatically installed and are no longer required:
83 debhelper po-debconf
84 Use 'apt-get autoremove' to remove them.
85 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
86 testequal "Reading package lists...
87 Building dependency tree...
88 Reading state information...
89 2 packages were automatically installed and are no longer required.
90 Use 'apt-get autoremove' to remove them.
91 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
92
93 testsuccess aptmark hold debhelper
94 testsuccessequal 'Reading package lists...
95 Building dependency tree...
96 Reading state information...
97 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s