summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-767891-force-essential-important
blob: 7a23de557861b9a92de400ec81df5a6f570e83ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64' 'i386'

insertinstalledpackage 'apt' 'amd64' '1'
insertinstalledpackage 'foo' 'amd64,i386' '1' 'Multi-Arch: same'
insertinstalledpackage 'bar' 'amd64' '1' 'Provides: foo'

insertpackage 'unstable' 'foo2' 'amd64,i386' '1' 'Multi-Arch: same'

setupaptarchive

rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
  apt* bar* foo* foo:i386*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Purg apt [1]
Purg bar [1]
Purg foo [1]
Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s

rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
  apt* bar* foo* foo:i386*
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Purg apt [1]
Purg bar [1]
Purg foo [1]
Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential=''

msgmsg 'foo:i386 got the Important flag'
rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
  apt* bar* foo* foo:i386*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  foo foo:i386
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Purg apt [1]
Purg bar [1]
Purg foo [1]
Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential='foo'

rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
  apt* bar* foo* foo:i386*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt foo foo:i386
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Purg apt [1]
Purg bar [1]
Purg foo [1]
Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential::='foo'

msgmsg 'essentials only from native'
rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
  foo2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst foo2 (1 unstable [amd64])
Conf foo2 (1 unstable [amd64])' apt full-upgrade -s -o pkgCacheGen::ForceEssential::='foo2'

msgmsg 'important only effects installed'
rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
  apt* bar* foo* foo:i386*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt foo foo:i386
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Purg apt [1]
Purg bar [1]
Purg foo [1]
Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceImportant::='foo'
rm -f rootdir/var/cache/apt/*.bin
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' apt full-upgrade -s -o pkgCacheGen::ForceImportant::='foo2'