]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-604222-new-and-autoremove
reset HOME, USER(NAME), TMPDIR & SHELL in DropPrivileges
[apt.git] / test / integration / test-bug-604222-new-and-autoremove
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture "i386"
8
9 insertpackage 'stable' 'dummy-archive' 'i386' '0.invalid.0' 'Depends: libavcodec52, libvtk5-dev | libopenal-dev'
10 insertpackage 'stable' 'libavcodec52' 'i386' '4:0.5.2-6' 'Conflicts: libvtk5-dev'
11 insertpackage 'stable' 'libopenal-dev' 'i386' '1:1.12.854-2'
12 insertpackage 'stable' 'libvtk5-dev' 'i386' '5.4.2-8' 'Depends: libvtk5.4 (= 5.4.2-8)'
13 insertpackage 'stable' 'libvtk5.4' 'i386' '5.4.2-8' 'Depends: libavcodec52 (>= 4:0.5.1-1)'
14
15 insertpackage 'stable' 'gwenview' 'i386' '4:16.08.0-1' 'Depends: libkf5kipi-bin, libkf5kipi-data'
16 insertpackage 'stable' 'libkf5kipi-bin' 'i386' '4:16.08.0-1'
17 insertpackage 'stable' 'libkf5kipi-data' 'i386' '4:16.08.0-1' 'Breaks: libkipi-data'
18 insertpackage 'stable' 'libkipi-data' 'i386' '4:15.08.0-1' '' 'important'
19
20 setupaptarchive
21
22 cp -a rootdir/var/lib/dpkg/status rootdir/var/lib/dpkg/status.backup
23 insertinstalledpackage 'libvtk5.4' 'i386' '5.4.2-7'
24 testsuccess aptmark markauto 'libvtk5.4'
25 testmarkedauto 'libvtk5.4'
26
27 AUTOREMOVE='apt autoremove'
28 if [ -n "$SUDO_USER" ]; then
29 AUTOREMOVE="sudo $AUTOREMOVE"
30 fi
31
32 testsuccessequal "Reading package lists...
33 Building dependency tree...
34 Reading state information...
35 The following package was automatically installed and is no longer required:
36 libvtk5.4
37 Use '$AUTOREMOVE' to remove it.
38 The following NEW packages will be installed:
39 libavcodec52
40 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
41 Inst libavcodec52 (4:0.5.2-6 stable [i386])
42 Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s
43
44 testsuccessequal "Reading package lists...
45 Building dependency tree...
46 Reading state information...
47 1 package was automatically installed and is no longer required.
48 Use '$AUTOREMOVE' to remove it.
49 The following NEW packages will be installed:
50 libavcodec52
51 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
52 Inst libavcodec52 (4:0.5.2-6 stable [i386])
53 Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s -o APT::Get::HideAutoRemove=small
54
55 testfailureequal "Reading package lists...
56 Building dependency tree...
57 Reading state information...
58 The following package was automatically installed and is no longer required:
59 libvtk5.4
60 Use '$AUTOREMOVE' to remove it.
61 The following additional packages will be installed:
62 libavcodec52 libopenal-dev libvtk5.4
63 The following NEW packages will be installed:
64 dummy-archive libavcodec52 libopenal-dev
65 The following packages will be upgraded:
66 libvtk5.4
67 1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
68 After this operation, 129 kB of additional disk space will be used.
69 E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only
70 testequal "Reading package lists...
71 Building dependency tree...
72 Reading state information...
73 1 package was automatically installed and is no longer required.
74 Use '$AUTOREMOVE' to remove it.
75 The following additional packages will be installed:
76 libavcodec52 libopenal-dev libvtk5.4
77 The following NEW packages will be installed:
78 dummy-archive libavcodec52 libopenal-dev
79 The following packages will be upgraded:
80 libvtk5.4
81 1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
82 After this operation, 129 kB of additional disk space will be used.
83 E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only -o APT::Get::HideAutoRemove=small
84
85 cp rootdir/var/lib/dpkg/status.backup rootdir/var/lib/dpkg/status
86 rm -f rootdir/var/lib/apt/extended_states
87
88 CONFLICTING='Reading package lists...
89 Building dependency tree...
90 MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1
91 MarkInstall libavcodec52:i386 < none -> 4:0.5.2-6 @un uN > FU=0
92 MarkInstall libvtk5-dev:i386 < none -> 5.4.2-8 @un uN Ib > FU=0
93 MarkInstall libvtk5.4:i386 < none -> 5.4.2-8 @un uN > FU=0
94 MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
95 MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
96 MarkDelete libvtk5.4:i386 < none -> 5.4.2-8 @un ugN > FU=0
97 The following additional packages will be installed:
98 libavcodec52 libopenal-dev
99 The following NEW packages will be installed:
100 dummy-archive libavcodec52 libopenal-dev
101 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
102 After this operation, 129 kB of additional disk space will be used.
103 E: Trivial Only specified but this is not a trivial operation.'
104
105 testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0
106 testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1
107 testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small
108
109 insertinstalledpackage 'my-metapackage' 'i386' '1' 'Depends: gwenview'
110 insertinstalledpackage 'gwenview' 'i386' '4:15.08.0-1' 'Depends: libkipi-data
111 Recommends: foobar' # trigger policy brokenness to avoid optimisation
112 insertinstalledpackage 'libkipi-data' 'i386' '4:15.08.0-1' '' 'important'
113 testsuccess aptmark markauto 'gwenview'
114
115 testsuccessequal "Reading package lists...
116 Building dependency tree...
117 Reading state information...
118 Calculating upgrade...
119 The following packages have been kept back:
120 gwenview
121 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt dist-upgrade -s