]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-770291-reinstall
Don't download "optional" files not in Release :/.
[apt.git] / test / integration / test-bug-770291-reinstall
CommitLineData
4e6a7e26
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
4e6a7e26
DK
6setupenvironment
7configarchitecture 'i386'
8
9insertpackage 'unstable,installed' 'libc6' 'i386' '1'
10insertpackage 'unstable,installed' 'libselinux1' 'i386' '1'
11
12cp rootdir/var/lib/dpkg/status dpkg.status
13
14insertpackage 'unstable,installed' 'init' 'i386' '1' 'Depends: systemd-sysv
15Essential: yes'
16insertpackage 'unstable,installed' 'systemd-sysv' 'i386' '215-5+b1' 'Depends: systemd (= 215-5+b1)
17Pre-Depends: systemd'
18# fun fact: we need these two pre-depends to get systemd ordered before systemd-sysv as
19# many pre-depends mean: do early (as they are a pain, so get them out of the way early)
20insertpackage 'unstable,installed' 'systemd' 'i386' '215-5+b1' 'Pre-Depends: libc6, libselinux1'
21
22# depends loop
03dfa26f 23insertpackage 'unstable,installed' 'dependsa' 'i386' '1' 'Depends: dependsb
4e6a7e26 24Essential: yes'
03dfa26f 25insertpackage 'unstable,installed' 'dependsb' 'i386' '1' 'Depends: dependsa
4e6a7e26
DK
26Essential: yes'
27
28# pre-depends loop
03dfa26f 29insertpackage 'unstable,installed' 'predependsa' 'i386' '1' 'Pre-Depends: predependsb
4e6a7e26 30Essential: yes'
03dfa26f 31insertpackage 'unstable,installed' 'predependsb' 'i386' '1' 'Pre-Depends: predependsa
4e6a7e26
DK
32Essential: yes'
33
34# pre-depends-to-depends loop
03dfa26f 35insertpackage 'unstable,installed' 'predependsdependsa' 'i386' '1' 'Pre-Depends: predependsdependsb
4e6a7e26 36Essential: yes'
03dfa26f 37insertpackage 'unstable,installed' 'predependsdependsb' 'i386' '1' 'Depends: predependsdependsa
4e6a7e26
DK
38Essential: yes'
39
40setupaptarchive
41
25b86db1 42testsuccessequal 'Reading package lists...
4e6a7e26
DK
43Building dependency tree...
440 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
45Inst systemd [215-5+b1] (215-5+b1 unstable [i386])
46Conf systemd (215-5+b1 unstable [i386])
47Inst systemd-sysv [215-5+b1] (215-5+b1 unstable [i386])
48Conf systemd-sysv (215-5+b1 unstable [i386])' aptget install --reinstall systemd systemd-sysv -s
49
25b86db1 50testsuccessequal 'Reading package lists...
4e6a7e26
DK
51Building dependency tree...
520 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
03dfa26f
JAK
53Inst dependsa [1] (1 unstable [i386])
54Inst dependsb [1] (1 unstable [i386])
55Conf dependsb (1 unstable [i386])
56Conf dependsa (1 unstable [i386])' aptget install --reinstall dependsa dependsb -s
4e6a7e26
DK
57
58# there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present
59# which is very very risky to depend on (and apt doesn't know about that anyhow).
03dfa26f 60testfailure aptget install --reinstall predependsa predependsb -s -o Debug::pkgPackageManager=1
91abb30f 61testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output
4e6a7e26
DK
62
63# FIXME: the error message is a catch all here, not like the one above
03dfa26f 64testfailure aptget install --reinstall predependsdependsa predependsdependsb -s -o Debug::pkgPackageManager=1
91abb30f 65testsuccess grep "^E: Could not configure 'predependsdependsb:i386'. $" rootdir/tmp/testfailure.output
4e6a7e26
DK
66
67
68msgmsg 'While we are at it, lets try these loops without reinstall as well'
69cp dpkg.status rootdir/var/lib/dpkg/status
70
25b86db1 71testsuccessequal 'Reading package lists...
4e6a7e26
DK
72Building dependency tree...
73The following NEW packages will be installed:
74 systemd systemd-sysv
750 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
76Inst systemd (215-5+b1 unstable [i386])
77Conf systemd (215-5+b1 unstable [i386])
78Inst systemd-sysv (215-5+b1 unstable [i386])
79Conf systemd-sysv (215-5+b1 unstable [i386])' aptget install systemd systemd-sysv -s
80
25b86db1 81testsuccessequal 'Reading package lists...
4e6a7e26
DK
82Building dependency tree...
83The following NEW packages will be installed:
03dfa26f 84 dependsa dependsb
4e6a7e26 850 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
03dfa26f
JAK
86Inst dependsa (1 unstable [i386]) []
87Inst dependsb (1 unstable [i386])
88Conf dependsb (1 unstable [i386])
89Conf dependsa (1 unstable [i386])' aptget install dependsa dependsb -s
4e6a7e26
DK
90
91# there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present
92# which is very very risky to depend on (and apt doesn't know about that anyhow).
03dfa26f 93testfailure aptget install predependsa predependsb -s -o Debug::pkgPackageManager=1
91abb30f 94testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output
4e6a7e26
DK
95
96# FIXME: the error message is a catch all here, not like the one above
03dfa26f 97testfailure aptget install predependsdependsa predependsdependsb -s -o Debug::pkgPackageManager=1
91abb30f 98testsuccess grep "^E: Could not configure 'predependsdependsb:i386'. $" rootdir/tmp/testfailure.output