]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-autoremove
disable updating insecure repositories in apt by default
[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
22AUTOREMOVE='apt autoremove'
23if [ -n "$SUDO_USER" ]; then
24 AUTOREMOVE="sudo $AUTOREMOVE"
25fi
26echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
27testsuccessequal 'Reading package lists...
28Building dependency tree...
29Reading state information...
30The following packages will be REMOVED:
31 po-debconf
320 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
33Remv po-debconf [1.0.16]' aptget autoremove -s
34testequal "Reading package lists...
35Building dependency tree...
36Reading state information...
37The following package was automatically installed and is no longer required:
38 po-debconf
39Use '$AUTOREMOVE' to remove it.
400 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
41testequal "Reading package lists...
42Building dependency tree...
43Reading state information...
441 package was automatically installed and is no longer required.
45Use '$AUTOREMOVE' to remove it.
460 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
47testdpkginstalled 'po-debconf'
48
49echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
50testsuccess aptget autoremove -y
51testdpkginstalled 'po-debconf'
52
53echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
54testsuccess aptget autoremove -y
55testdpkginstalled "po-debconf"
56
57rm rootdir/etc/apt/apt.conf.d/00autoremove
58testsuccess aptget autoremove -y
59testdpkgnotinstalled 'po-debconf'
60testmarkedauto
61
62sed 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
63testfileequal 'apt-history.log' '
64Install: debhelper:i386 (8.0.0)
65Install: po-debconf:i386 (1.0.16, automatic)
66Install: unrelated:i386 (1)
67Remove: debhelper:i386 (8.0.0)
68Remove: po-debconf:i386 (1.0.16)'
69
70testsuccess aptget install debhelper -y
71testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
72testsuccess aptmark auto debhelper
73
74testmarkedauto 'debhelper' 'po-debconf'
75testsuccessequal 'Reading package lists...
76Building dependency tree...
77Reading state information...
78The following packages will be REMOVED:
79 debhelper po-debconf
800 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
81Remv debhelper [8.0.0]
82Remv po-debconf [1.0.16]' aptget autoremove -s
83testequal "Reading package lists...
84Building dependency tree...
85Reading state information...
86The following packages were automatically installed and are no longer required:
87 debhelper po-debconf
88Use '$AUTOREMOVE' to remove them.
890 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
90testequal "Reading package lists...
91Building dependency tree...
92Reading state information...
932 packages were automatically installed and are no longer required.
94Use '$AUTOREMOVE' to remove them.
950 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
96
97testsuccess aptmark hold debhelper
98testsuccessequal 'Reading package lists...
99Building dependency tree...
100Reading state information...
1010 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s
102
103testsuccess aptget autoremove debhelper -y --allow-change-held-packages
104testdpkgnotinstalled 'po-debconf' 'debhelper'
105testmarkedauto
106testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1
107testmarkedauto 'po-debconf'