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