]> git.saurik.com Git - apt.git/blame - test/integration/test-essential-force-loopbreak
Merge remote-tracking branch 'mvo/debian/sid' into debian/sid
[apt.git] / test / integration / test-essential-force-loopbreak
CommitLineData
0eb4af9d
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture 'amd64'
9
10insertinstalledpackage 'sysvinit' 'amd64' '1' 'Essential: yes'
11
12buildsimplenativepackage 'sysvinit' 'amd64' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
13Essential: yes'
14buildsimplenativepackage 'sysvinit-core' 'amd64' '2' 'sid'
15
16buildsimplenativepackage 'systemd-sysv' 'amd64' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
17Breaks: sysvinit-core'
18
19buildsimplenativepackage 'systemd-sysv' 'amd64' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
20
21setupaptarchive
22
23cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
24
25testforcebreak() {
26 cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
27 rm -f rootdir/var/lib/apt/extended_states
28 testequal 'Reading package lists...
29Building dependency tree...
30The following extra packages will be installed:
31 sysvinit
32The following NEW packages will be installed:
33 systemd-sysv
34The following packages will be upgraded:
35 sysvinit
361 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
37E: This installation run will require temporarily removing the essential package sysvinit:amd64 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.
38E: Internal Error, Could not early remove sysvinit:amd64 (2)' aptget install systemd-sysv -t "$1" -s
39 # ensure that really nothing happens
40 testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=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 Debug::pkgPackageManager=1 -o APT::Force-LoopBreak=1
47 testdpkginstalled 'sysvinit' 'systemd-sysv'
48}
49
50testforcebreak 'sid-conflict'
51testforcebreak 'sid-break'