summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-get-install-virtual-pkgs
blob: 99e01ab2c6578f7f16f9dfe38310fab2d3b838c5 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/sh
set -e

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

insertpackage 'unstable' 'foo' 'amd64' '1' 'Provides: foo-prv'

insertpackage 'unstable' 'baz1' 'amd64' '1' 'Provides: foo-prv1'
insertpackage 'unstable' 'foo1' 'amd64' '1' 'Provides: foo-prv1'

insertpackage 'unstable' 'baz2' 'amd64' '1' 'Provides: foo-prv2'
insertpackage 'unstable' 'foo2' 'amd64' '2' 'Provides: foo-prv2:amd64'

insertpackage 'unstable' 'baz3' 'amd64' '1' 'Provides: foo-prv3'
insertpackage 'unstable' 'foo3' 'i386' '2' 'Provides: foo-prv3:amd64'

insertpackage 'unstable' 'baz4' 'amd64' '1' 'Provides: foo-prv4:amd64'
insertpackage 'unstable' 'foo4' 'i386' '2' 'Provides: foo-prv4:amd64'

insertpackage 'experimental' 'baz5' 'amd64' '1' 'Provides: foo-prv5:amd64'
insertpackage 'experimental' 'foo5' 'i386' '2' 'Provides: foo-prv5:amd64'

insertpackage 'stable' 'debhelper' 'amd64,i386' '1' 'Provides: debhelper-compat (= 12)'
insertpackage 'unstable,testing' 'debhelper' 'amd64,i386' '2' 'Provides: debhelper-compat (= 13)'
insertpackage 'experimental' 'debhelper' 'amd64,i386' '3' 'Provides: debhelper-compat (= 13)'
insertpackage 'experimental' 'debhelper-ng' 'amd64,i386' '4' 'Provides: debhelper-compat (= 13)'

setupaptarchive

testsuccessequal "Reading package lists...
Building dependency tree...
Note, selecting 'foo' instead of 'foo-prv'
The following NEW packages will be installed:
  foo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst foo (1 unstable [amd64])
Conf foo (1 unstable [amd64])" aptget install foo-prv -s

testvirtuals() {
	testfailureequal "Reading package lists...
Building dependency tree...
Package $1 is a virtual package provided by:
  $3
  $2
You should explicitly select one to install.

E: Package '$1' has no installation candidate" aptget install $1 -s
}

testvirtuals 'foo-prv1' 'baz1 1' 'foo1 1'
testvirtuals 'foo-prv2' 'baz2 1' 'foo2 2'
testvirtuals 'foo-prv3' 'baz3 1' 'foo3:i386 2'
testvirtuals 'foo-prv4' 'baz4 1' 'foo4:i386 2'
testvirtuals 'foo-prv5' 'baz5 1' 'foo5:i386 2'

echo 'Package: *
Pin: release a=experimental
Pin-Priority: -1' > rootdir/etc/apt/preferences.d/experimental.pref

testfailureequal "Reading package lists...
Building dependency tree...
Package foo-prv5 is a virtual package provided by:
  foo5:i386 2 [Not candidate version]
  baz5 1 [Not candidate version]

E: Package 'foo-prv5' has no installation candidate" aptget install foo-prv5 -s

testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
  debhelper
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst debhelper (2 testing, unstable [amd64])
Conf debhelper (2 testing, unstable [amd64])' apt install debhelper -s
testsuccessequal "Reading package lists...
Building dependency tree...
Note, selecting 'debhelper' instead of 'debhelper-compat'
The following NEW packages will be installed:
  debhelper
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst debhelper (2 testing, unstable [amd64])
Conf debhelper (2 testing, unstable [amd64])" apt install debhelper-compat -s
testsuccessequal "Reading package lists...
Building dependency tree...
Note, selecting 'debhelper' instead of 'debhelper-compat'
Selected version '1' (stable [amd64]) for 'debhelper'
The following NEW packages will be installed:
  debhelper
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst debhelper (1 stable [amd64])
Conf debhelper (1 stable [amd64])" apt install debhelper-compat=12 -s
testsuccessequal "Reading package lists...
Building dependency tree...
Note, selecting 'debhelper' instead of 'debhelper-compat'
Selected version '1' (stable [amd64]) for 'debhelper'
The following NEW packages will be installed:
  debhelper
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst debhelper (1 stable [amd64])
Conf debhelper (1 stable [amd64])" apt install debhelper-compat/stable -s
# by version selection we have selected the experimental debhelper-ng here
# but dehelper stays at the candidate as it already provides 13
testfailureequal "Reading package lists...
Building dependency tree...
Package debhelper-compat is a virtual package provided by:
  debhelper 2 (= 13)
  debhelper-ng 4 (= 13)
You should explicitly select one to install.

E: Version '13' for 'debhelper-compat' was not found" apt install debhelper-compat=13 -s
testsuccessequal "Reading package lists...
Building dependency tree...
Note, selecting 'debhelper' instead of 'debhelper-compat'
Selected version '2' (testing, unstable [amd64]) for 'debhelper'
The following NEW packages will be installed:
  debhelper
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst debhelper (2 testing, unstable [amd64])
Conf debhelper (2 testing, unstable [amd64])" apt install debhelper-compat/unstable -s
testfailureequal "Reading package lists...
Building dependency tree...
Package debhelper-compat is a virtual package provided by:
  debhelper-ng 4 (= 13)
  debhelper 3 (= 13)
You should explicitly select one to install.

E: Version '13' for 'debhelper-compat' was not found" apt install debhelper-compat=13 -st experimental
testfailureequal "Reading package lists...
Building dependency tree...
Package debhelper-compat is a virtual package provided by:
  debhelper-ng 4 (= 13)
  debhelper 3 (= 13)
You should explicitly select one to install.

E: Release 'experimental' for 'debhelper-compat' was not found" apt install debhelper-compat/experimental -s