]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-767891-force-essential-important
Merge commit 'e2073b0276226b625897ef475f225bf8f508719e' as 'triehash'
[apt.git] / test / integration / test-bug-767891-force-essential-important
CommitLineData
a9b724ee
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9insertinstalledpackage 'apt' 'amd64' '1'
10insertinstalledpackage 'foo' 'amd64,i386' '1' 'Multi-Arch: same'
11insertinstalledpackage 'bar' 'amd64' '1' 'Provides: foo'
12
13insertpackage 'unstable' 'foo2' 'amd64,i386' '1' 'Multi-Arch: same'
14
15setupaptarchive
16
17rm -f rootdir/var/cache/apt/*.bin
18testsuccessequal 'Reading package lists...
19Building dependency tree...
20The following packages will be REMOVED:
21 apt* bar* foo* foo:i386*
22WARNING: The following essential packages will be removed.
23This should NOT be done unless you know exactly what you are doing!
24 apt
250 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
26Purg apt [1]
27Purg bar [1]
28Purg foo [1]
29Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s
30
31rm -f rootdir/var/cache/apt/*.bin
32testsuccessequal 'Reading package lists...
33Building dependency tree...
34The following packages will be REMOVED:
35 apt* bar* foo* foo:i386*
360 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
37Purg apt [1]
38Purg bar [1]
39Purg foo [1]
40Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential=''
41
42msgmsg 'foo:i386 got the Important flag'
43rm -f rootdir/var/cache/apt/*.bin
44testsuccessequal 'Reading package lists...
45Building dependency tree...
46The following packages will be REMOVED:
47 apt* bar* foo* foo:i386*
48WARNING: The following essential packages will be removed.
49This should NOT be done unless you know exactly what you are doing!
50 foo foo:i386
510 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
52Purg apt [1]
53Purg bar [1]
54Purg foo [1]
55Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential='foo'
56
57rm -f rootdir/var/cache/apt/*.bin
58testsuccessequal 'Reading package lists...
59Building dependency tree...
60The following packages will be REMOVED:
61 apt* bar* foo* foo:i386*
62WARNING: The following essential packages will be removed.
63This should NOT be done unless you know exactly what you are doing!
64 apt foo foo:i386
650 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
66Purg apt [1]
67Purg bar [1]
68Purg foo [1]
69Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential::='foo'
70
71msgmsg 'essentials only from native'
72rm -f rootdir/var/cache/apt/*.bin
73testsuccessequal 'Reading package lists...
74Building dependency tree...
75Calculating upgrade...
76The following NEW packages will be installed:
77 foo2
780 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
79Inst foo2 (1 unstable [amd64])
80Conf foo2 (1 unstable [amd64])' apt full-upgrade -s -o pkgCacheGen::ForceEssential::='foo2'
81
82msgmsg 'important only effects installed'
83rm -f rootdir/var/cache/apt/*.bin
84testsuccessequal 'Reading package lists...
85Building dependency tree...
86The following packages will be REMOVED:
87 apt* bar* foo* foo:i386*
88WARNING: The following essential packages will be removed.
89This should NOT be done unless you know exactly what you are doing!
90 apt foo foo:i386
910 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
92Purg apt [1]
93Purg bar [1]
94Purg foo [1]
95Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceImportant::='foo'
96rm -f rootdir/var/cache/apt/*.bin
97testsuccessequal 'Reading package lists...
98Building dependency tree...
99Calculating upgrade...
1000 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' apt full-upgrade -s -o pkgCacheGen::ForceImportant::='foo2'