]> git.saurik.com Git - apt.git/blob - test/integration/test-essential-force-loopbreak
Make directory paths configurable
[apt.git] / test / integration / test-essential-force-loopbreak
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture 'native'
9
10 insertinstalledpackage 'sysvinit' 'native' '1' 'Essential: yes'
11
12 buildsimplenativepackage 'sysvinit' 'native' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
13 Essential: yes'
14 buildsimplenativepackage 'sysvinit-core' 'native' '2' 'sid'
15
16 buildsimplenativepackage 'systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
17 Breaks: sysvinit-core'
18
19 buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
20
21 setupaptarchive
22
23 cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
24
25 testforcebreak() {
26 cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
27 rm -f rootdir/var/lib/apt/extended_states
28 testfailureequal "Reading package lists...
29 Building dependency tree...
30 The following additional packages will be installed:
31 sysvinit
32 The following NEW packages will be installed:
33 systemd-sysv
34 The following packages will be upgraded:
35 sysvinit
36 1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
37 E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
38 E: Internal Error, Could not early remove sysvinit:$(dpkg --print-architecture) (2)" aptget install systemd-sysv -t "$1" -s
39 # ensure that really nothing happens
40 testfailure aptget install systemd-sysv -y -t "$1"
41 testdpkginstalled 'sysvinit'
42 testdpkgnotinstalled 'systemd-sysv'
43
44 # with enough force however …
45 cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
46 testsuccess aptget install systemd-sysv -y -t "$1" -o APT::Force-LoopBreak=1 -o Debug::pkgDpkgPm=1
47 cp rootdir/tmp/testsuccess.output apt.output
48 testsuccess grep -- '--force-remove-essential --remove sysvinit' apt.output
49 testsuccess aptget install systemd-sysv -y -t "$1" -o APT::Force-LoopBreak=1
50 testdpkginstalled 'sysvinit' 'systemd-sysv'
51 }
52
53 testforcebreak 'sid-conflict'
54 testforcebreak 'sid-break'