]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-autoremove
Ensure that no by-hash file for "Release/InRelease is written"
[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
23testsuccessequal '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
30testequal "Reading package lists...
31Building dependency tree...
32Reading state information...
33The following package was automatically installed and is no longer required:
34 po-debconf
35Use 'apt-get autoremove' to remove it.
360 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
37testequal "Reading package lists...
38Building dependency tree...
39Reading state information...
401 package was automatically installed and is no longer required.
41Use 'apt-get autoremove' to remove it.
420 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
43testdpkginstalled 'po-debconf'
44
45echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
46testsuccess aptget autoremove -y
47testdpkginstalled 'po-debconf'
48
49echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
50testsuccess aptget autoremove -y
51testdpkginstalled "po-debconf"
52
53rm rootdir/etc/apt/apt.conf.d/00autoremove
54testsuccess aptget autoremove -y
55testdpkgnotinstalled 'po-debconf'
56testmarkedauto
57
58sed 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
59testfileequal 'apt-history.log' '
60Install: debhelper:i386 (8.0.0)
61Install: po-debconf:i386 (1.0.16, automatic)
62Install: unrelated:i386 (1)
63Remove: debhelper:i386 (8.0.0)
64Remove: po-debconf:i386 (1.0.16)'
65
66testsuccess aptget install debhelper -y
67testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
68testsuccess aptmark auto debhelper
69
70testmarkedauto 'debhelper' 'po-debconf'
71testsuccessequal 'Reading package lists...
72Building dependency tree...
73Reading state information...
74The following packages will be REMOVED:
75 debhelper po-debconf
760 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
77Remv debhelper [8.0.0]
78Remv po-debconf [1.0.16]' aptget autoremove -s
79testequal "Reading package lists...
80Building dependency tree...
81Reading state information...
82The following packages were automatically installed and are no longer required:
83 debhelper po-debconf
84Use 'apt-get autoremove' to remove them.
850 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
86testequal "Reading package lists...
87Building dependency tree...
88Reading state information...
892 packages were automatically installed and are no longer required.
90Use 'apt-get autoremove' to remove them.
910 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
92
93testsuccess aptmark hold debhelper
94testsuccessequal 'Reading package lists...
95Building dependency tree...
96Reading state information...
970 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s