]>
Commit | Line | Data |
---|---|---|
b093a199 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
b093a199 | 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' |
b820fd59 DK |
21 | echo 'unrelated purge' | dpkg --set-selections |
22 | testdpkgstatus 'pi' '1' 'unrelated' | |
01a6e24c | 23 | |
73fe49f9 DK |
24 | AUTOREMOVE='apt autoremove' |
25 | if [ -n "$SUDO_USER" ]; then | |
26 | AUTOREMOVE="sudo $AUTOREMOVE" | |
27 | fi | |
01a6e24c | 28 | echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove |
25b86db1 | 29 | testsuccessequal 'Reading package lists... |
01a6e24c DK |
30 | Building dependency tree... |
31 | Reading state information... | |
32 | The following packages will be REMOVED: | |
33 | po-debconf | |
34 | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
35 | Remv po-debconf [1.0.16]' aptget autoremove -s | |
a0c19a21 DK |
36 | testequal "Reading package lists... |
37 | Building dependency tree... | |
38 | Reading state information... | |
39 | The following package was automatically installed and is no longer required: | |
40 | po-debconf | |
73fe49f9 | 41 | Use '$AUTOREMOVE' to remove it. |
a0c19a21 DK |
42 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s |
43 | testequal "Reading package lists... | |
44 | Building dependency tree... | |
45 | Reading state information... | |
46 | 1 package was automatically installed and is no longer required. | |
73fe49f9 | 47 | Use '$AUTOREMOVE' to remove it. |
a0c19a21 | 48 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small |
01a6e24c DK |
49 | testdpkginstalled 'po-debconf' |
50 | ||
51 | echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove | |
0440d936 | 52 | testsuccess aptget autoremove -y |
01a6e24c | 53 | testdpkginstalled 'po-debconf' |
b820fd59 | 54 | testdpkgstatus 'pi' '1' 'unrelated' |
b093a199 | 55 | |
01a6e24c | 56 | echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove |
0440d936 | 57 | testsuccess aptget autoremove -y |
01a6e24c | 58 | testdpkginstalled "po-debconf" |
b820fd59 | 59 | testdpkgstatus 'pi' '1' 'unrelated' |
01a6e24c DK |
60 | |
61 | rm rootdir/etc/apt/apt.conf.d/00autoremove | |
0440d936 | 62 | testsuccess aptget autoremove -y |
5cf733e1 | 63 | testdpkgnotinstalled 'po-debconf' |
b820fd59 | 64 | testdpkgstatus 'pi' '1' 'unrelated' |
ec7f904e | 65 | testmarkedauto |
b093a199 | 66 | |
0479205d DK |
67 | sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' \ |
68 | -e '/^Start-Date: / d' -e '/^End-Date: / d' \ | |
69 | -e '/^Requested-By: / d' \ | |
70 | -e 's#), #)\nInstall: #g' | sort -u > apt-history.log | |
a7250ed0 DK |
71 | testfileequal 'apt-history.log' ' |
72 | Install: debhelper:i386 (8.0.0) | |
73 | Install: po-debconf:i386 (1.0.16, automatic) | |
74 | Install: unrelated:i386 (1) | |
b093a199 | 75 | Remove: debhelper:i386 (8.0.0) |
b093a199 | 76 | Remove: po-debconf:i386 (1.0.16)' |
8fa042ca DK |
77 | |
78 | testsuccess aptget install debhelper -y | |
b820fd59 DK |
79 | testdpkgstatus 'pi' '1' 'unrelated' |
80 | testdpkginstalled 'debhelper' 'po-debconf' | |
8fa042ca DK |
81 | testsuccess aptmark auto debhelper |
82 | ||
83 | testmarkedauto 'debhelper' 'po-debconf' | |
25b86db1 | 84 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
85 | Building dependency tree... |
86 | Reading state information... | |
87 | The following packages will be REMOVED: | |
88 | debhelper po-debconf | |
89 | 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. | |
90 | Remv debhelper [8.0.0] | |
91 | Remv po-debconf [1.0.16]' aptget autoremove -s | |
a0c19a21 DK |
92 | testequal "Reading package lists... |
93 | Building dependency tree... | |
94 | Reading state information... | |
95 | The following packages were automatically installed and are no longer required: | |
96 | debhelper po-debconf | |
73fe49f9 | 97 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 DK |
98 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s |
99 | testequal "Reading package lists... | |
100 | Building dependency tree... | |
101 | Reading state information... | |
102 | 2 packages were automatically installed and are no longer required. | |
73fe49f9 | 103 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 | 104 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small |
8fa042ca DK |
105 | |
106 | testsuccess aptmark hold debhelper | |
25b86db1 | 107 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
108 | Building dependency tree... |
109 | Reading state information... | |
110 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s | |
9777639e DK |
111 | |
112 | testsuccess aptget autoremove debhelper -y --allow-change-held-packages | |
113 | testdpkgnotinstalled 'po-debconf' 'debhelper' | |
b820fd59 | 114 | testdpkgstatus 'pi' '1' 'unrelated' |
9777639e DK |
115 | testmarkedauto |
116 | testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1 | |
117 | testmarkedauto 'po-debconf' | |
b820fd59 | 118 | testdpkgstatus 'pi' '1' 'unrelated' |
a0ed43f7 DK |
119 | |
120 | insertinstalledpackage 'bar' 'all' '1' 'Depends: foo-provider' | |
121 | insertinstalledpackage 'foo-multi1-1' 'all' '1' 'Provides: foo-provider | |
122 | Source: foo-multi (1)' | |
123 | insertinstalledpackage 'foo-multi1-2' 'all' '1' 'Provides: foo-provider | |
124 | Source: foo-multi (2)' | |
125 | insertinstalledpackage 'foo-multi1-3' 'all' '1' 'Provides: foo-provider | |
126 | Source: foo-multi (3)' | |
127 | insertinstalledpackage 'foo-multi2-1' 'all' '1' 'Provides: foo-provider | |
128 | Source: foo-multi (1)' | |
129 | insertinstalledpackage 'foo-multi2-2' 'all' '1' 'Provides: foo-provider | |
130 | Source: foo-multi (2)' | |
131 | insertinstalledpackage 'foo-multi2-3' 'all' '1' 'Provides: foo-provider | |
132 | Source: foo-multi (3)' | |
133 | insertinstalledpackage 'foo-plus-1' 'all' '1' 'Provides: foo-provider | |
134 | Source: foo-plus (1)' | |
135 | insertinstalledpackage 'foo-plus-2' 'all' '1' 'Provides: foo-provider | |
136 | Source: foo-plus (2)' | |
137 | insertinstalledpackage 'foo-plus-3' 'all' '1' 'Provides: foo-provider | |
138 | Source: foo-plus (3)' | |
139 | insertinstalledpackage 'foo-single-1' 'all' '1' 'Provides: foo-provider' | |
140 | insertinstalledpackage 'foo-single-2' 'all' '1' 'Provides: foo-provider' | |
141 | ||
142 | testsuccess aptmark auto 'foo-*' | |
143 | testsuccessequal 'Reading package lists... | |
144 | Building dependency tree... | |
145 | Reading state information... | |
146 | The following packages will be REMOVED: | |
147 | foo-multi1-1 foo-multi1-2 foo-multi2-1 foo-multi2-2 foo-plus-1 foo-plus-2 | |
148 | 0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded. | |
149 | Remv foo-multi1-1 [1] | |
150 | Remv foo-multi1-2 [1] | |
151 | Remv foo-multi2-1 [1] | |
152 | Remv foo-multi2-2 [1] | |
153 | Remv foo-plus-1 [1] | |
154 | Remv foo-plus-2 [1]' apt autoremove -s |