]>
Commit | Line | Data |
---|---|---|
b093a199 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
9962ae93 | 4 | TESTDIR=$(readlink -f $(dirname $0)) |
b093a199 DK |
5 | . $TESTDIR/framework |
6 | setupenvironment | |
01a6e24c | 7 | configarchitecture 'i386' |
b093a199 | 8 | |
01a6e24c DK |
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' | |
b093a199 DK |
12 | setupaptarchive |
13 | ||
0440d936 | 14 | testsuccess aptget install unrelated debhelper -y |
01a6e24c | 15 | testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' |
b093a199 | 16 | |
ec7f904e | 17 | testmarkedauto 'po-debconf' |
0440d936 | 18 | testsuccess aptget remove debhelper -y |
5cf733e1 | 19 | testdpkgnotinstalled 'debhelper' |
87bc1c45 | 20 | testdpkginstalled 'po-debconf' 'unrelated' |
01a6e24c | 21 | |
73fe49f9 DK |
22 | AUTOREMOVE='apt autoremove' |
23 | if [ -n "$SUDO_USER" ]; then | |
24 | AUTOREMOVE="sudo $AUTOREMOVE" | |
25 | fi | |
01a6e24c | 26 | echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove |
25b86db1 | 27 | testsuccessequal 'Reading package lists... |
01a6e24c DK |
28 | Building dependency tree... |
29 | Reading state information... | |
30 | The following packages will be REMOVED: | |
31 | po-debconf | |
32 | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
33 | Remv po-debconf [1.0.16]' aptget autoremove -s | |
a0c19a21 DK |
34 | testequal "Reading package lists... |
35 | Building dependency tree... | |
36 | Reading state information... | |
37 | The following package was automatically installed and is no longer required: | |
38 | po-debconf | |
73fe49f9 | 39 | Use '$AUTOREMOVE' to remove it. |
a0c19a21 DK |
40 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s |
41 | testequal "Reading package lists... | |
42 | Building dependency tree... | |
43 | Reading state information... | |
44 | 1 package was automatically installed and is no longer required. | |
73fe49f9 | 45 | Use '$AUTOREMOVE' to remove it. |
a0c19a21 | 46 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small |
01a6e24c DK |
47 | testdpkginstalled 'po-debconf' |
48 | ||
49 | echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove | |
0440d936 | 50 | testsuccess aptget autoremove -y |
01a6e24c | 51 | testdpkginstalled 'po-debconf' |
b093a199 | 52 | |
01a6e24c | 53 | echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove |
0440d936 | 54 | testsuccess aptget autoremove -y |
01a6e24c DK |
55 | testdpkginstalled "po-debconf" |
56 | ||
57 | rm rootdir/etc/apt/apt.conf.d/00autoremove | |
0440d936 | 58 | testsuccess aptget autoremove -y |
5cf733e1 | 59 | testdpkgnotinstalled 'po-debconf' |
ec7f904e | 60 | testmarkedauto |
b093a199 | 61 | |
a7250ed0 DK |
62 | 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 |
63 | testfileequal 'apt-history.log' ' | |
64 | Install: debhelper:i386 (8.0.0) | |
65 | Install: po-debconf:i386 (1.0.16, automatic) | |
66 | Install: unrelated:i386 (1) | |
b093a199 | 67 | Remove: debhelper:i386 (8.0.0) |
b093a199 | 68 | Remove: po-debconf:i386 (1.0.16)' |
8fa042ca DK |
69 | |
70 | testsuccess aptget install debhelper -y | |
71 | testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' | |
72 | testsuccess aptmark auto debhelper | |
73 | ||
74 | testmarkedauto 'debhelper' 'po-debconf' | |
25b86db1 | 75 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
76 | Building dependency tree... |
77 | Reading state information... | |
78 | The following packages will be REMOVED: | |
79 | debhelper po-debconf | |
80 | 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. | |
81 | Remv debhelper [8.0.0] | |
82 | Remv po-debconf [1.0.16]' aptget autoremove -s | |
a0c19a21 DK |
83 | testequal "Reading package lists... |
84 | Building dependency tree... | |
85 | Reading state information... | |
86 | The following packages were automatically installed and are no longer required: | |
87 | debhelper po-debconf | |
73fe49f9 | 88 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 DK |
89 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s |
90 | testequal "Reading package lists... | |
91 | Building dependency tree... | |
92 | Reading state information... | |
93 | 2 packages were automatically installed and are no longer required. | |
73fe49f9 | 94 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 | 95 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small |
8fa042ca DK |
96 | |
97 | testsuccess aptmark hold debhelper | |
25b86db1 | 98 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
99 | Building dependency tree... |
100 | Reading state information... | |
101 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s | |
9777639e DK |
102 | |
103 | testsuccess aptget autoremove debhelper -y --allow-change-held-packages | |
104 | testdpkgnotinstalled 'po-debconf' 'debhelper' | |
105 | testmarkedauto | |
106 | testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1 | |
107 | testmarkedauto 'po-debconf' |