]>
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' |
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 | |
0479205d DK |
62 | sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' \ |
63 | -e '/^Start-Date: / d' -e '/^End-Date: / d' \ | |
64 | -e '/^Requested-By: / d' \ | |
65 | -e 's#), #)\nInstall: #g' | sort -u > apt-history.log | |
a7250ed0 DK |
66 | testfileequal 'apt-history.log' ' |
67 | Install: debhelper:i386 (8.0.0) | |
68 | Install: po-debconf:i386 (1.0.16, automatic) | |
69 | Install: unrelated:i386 (1) | |
b093a199 | 70 | Remove: debhelper:i386 (8.0.0) |
b093a199 | 71 | Remove: po-debconf:i386 (1.0.16)' |
8fa042ca DK |
72 | |
73 | testsuccess aptget install debhelper -y | |
74 | testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' | |
75 | testsuccess aptmark auto debhelper | |
76 | ||
77 | testmarkedauto 'debhelper' 'po-debconf' | |
25b86db1 | 78 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
79 | Building dependency tree... |
80 | Reading state information... | |
81 | The following packages will be REMOVED: | |
82 | debhelper po-debconf | |
83 | 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. | |
84 | Remv debhelper [8.0.0] | |
85 | Remv po-debconf [1.0.16]' aptget autoremove -s | |
a0c19a21 DK |
86 | testequal "Reading package lists... |
87 | Building dependency tree... | |
88 | Reading state information... | |
89 | The following packages were automatically installed and are no longer required: | |
90 | debhelper po-debconf | |
73fe49f9 | 91 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 DK |
92 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s |
93 | testequal "Reading package lists... | |
94 | Building dependency tree... | |
95 | Reading state information... | |
96 | 2 packages were automatically installed and are no longer required. | |
73fe49f9 | 97 | Use '$AUTOREMOVE' to remove them. |
a0c19a21 | 98 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small |
8fa042ca DK |
99 | |
100 | testsuccess aptmark hold debhelper | |
25b86db1 | 101 | testsuccessequal 'Reading package lists... |
8fa042ca DK |
102 | Building dependency tree... |
103 | Reading state information... | |
104 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s | |
9777639e DK |
105 | |
106 | testsuccess aptget autoremove debhelper -y --allow-change-held-packages | |
107 | testdpkgnotinstalled 'po-debconf' 'debhelper' | |
108 | testmarkedauto | |
109 | testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1 | |
110 | testmarkedauto 'po-debconf' | |
a0ed43f7 DK |
111 | |
112 | insertinstalledpackage 'bar' 'all' '1' 'Depends: foo-provider' | |
113 | insertinstalledpackage 'foo-multi1-1' 'all' '1' 'Provides: foo-provider | |
114 | Source: foo-multi (1)' | |
115 | insertinstalledpackage 'foo-multi1-2' 'all' '1' 'Provides: foo-provider | |
116 | Source: foo-multi (2)' | |
117 | insertinstalledpackage 'foo-multi1-3' 'all' '1' 'Provides: foo-provider | |
118 | Source: foo-multi (3)' | |
119 | insertinstalledpackage 'foo-multi2-1' 'all' '1' 'Provides: foo-provider | |
120 | Source: foo-multi (1)' | |
121 | insertinstalledpackage 'foo-multi2-2' 'all' '1' 'Provides: foo-provider | |
122 | Source: foo-multi (2)' | |
123 | insertinstalledpackage 'foo-multi2-3' 'all' '1' 'Provides: foo-provider | |
124 | Source: foo-multi (3)' | |
125 | insertinstalledpackage 'foo-plus-1' 'all' '1' 'Provides: foo-provider | |
126 | Source: foo-plus (1)' | |
127 | insertinstalledpackage 'foo-plus-2' 'all' '1' 'Provides: foo-provider | |
128 | Source: foo-plus (2)' | |
129 | insertinstalledpackage 'foo-plus-3' 'all' '1' 'Provides: foo-provider | |
130 | Source: foo-plus (3)' | |
131 | insertinstalledpackage 'foo-single-1' 'all' '1' 'Provides: foo-provider' | |
132 | insertinstalledpackage 'foo-single-2' 'all' '1' 'Provides: foo-provider' | |
133 | ||
134 | testsuccess aptmark auto 'foo-*' | |
135 | testsuccessequal 'Reading package lists... | |
136 | Building dependency tree... | |
137 | Reading state information... | |
138 | The following packages will be REMOVED: | |
139 | foo-multi1-1 foo-multi1-2 foo-multi2-1 foo-multi2-2 foo-plus-1 foo-plus-2 | |
140 | 0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded. | |
141 | Remv foo-multi1-1 [1] | |
142 | Remv foo-multi1-2 [1] | |
143 | Remv foo-multi2-1 [1] | |
144 | Remv foo-multi2-2 [1] | |
145 | Remv foo-plus-1 [1] | |
146 | Remv foo-plus-2 [1]' apt autoremove -s |