summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-get-source-only
blob: b974146fffb4eb317aba3a96d72ecd64aa62058b (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
139
140
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"

setupenvironment
configarchitecture "amd64"


# not-foo builds foo, but foo builds not-foo
insertpackage 'stable' 'foo' 'amd64' '1.0' 'Source: not-foo'
insertsource 'stable' 'not-foo' 'amd64' '1.0' 'Build-Depends: not-foo-bd' 'foo'

insertpackage 'stable' 'not-foo' 'amd64' '1.0' 'Source: foo'
insertsource 'stable' 'foo' 'amd64' '1.0' 'Build-Depends: foo-bd' 'not-foo'

insertinstalledpackage 'build-essential' 'amd64' '1.0'

setupaptarchive

APTARCHIVE=$(readlink -f ./aptarchive)

HEADER='Reading package lists...'
DOWNLOADFOO="Need to get 0 B/25 B of source archives.
'file:${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7
'file:${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239"
DOWNLOADNOTFOO="Need to get 0 B/33 B of source archives.
'file:${APTARCHIVE}/not-foo_1.0.dsc' not-foo_1.0.dsc 15 SHA256:db578a571c87d2555e90245732042845be4f481755f5b2f5786ac7a26bde9f4f
'file:${APTARCHIVE}/not-foo_1.0.tar.gz' not-foo_1.0.tar.gz 18 SHA256:8701846f1cba0ca81c552ac0ec93e2a89ae113cf2872b9cd51b29b4a9ff6b122"

if [ "$APT_SOLVER" = "3.0" ]; then
BUILDDEPFOO="Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:foo : Depends: foo-bd but it is not installable
E: Unsatisfiable dependency group builddeps:foo:amd64=1 -> foo-bd:amd64"

BUILDDEPNOTFOO="Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:not-foo : Depends: not-foo-bd but it is not installable
E: Unsatisfiable dependency group builddeps:not-foo:amd64=1 -> not-foo-bd:amd64"
else
BUILDDEPFOO="Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:foo : Depends: foo-bd but it is not installable
E: Unable to correct problems, you have held broken packages."

BUILDDEPNOTFOO="Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:not-foo : Depends: not-foo-bd but it is not installable
E: Unable to correct problems, you have held broken packages."
fi

testsuccessequal "$HEADER
Picking 'not-foo' as source package instead of 'foo'
$DOWNLOADNOTFOO" aptget source -q --print-uris foo

testsuccessequal "$HEADER
Picking 'not-foo' as source package instead of 'foo'
$DOWNLOADNOTFOO" aptget source -q --print-uris foo:amd64

testsuccessequal "$HEADER
$DOWNLOADNOTFOO" aptget source -q --print-uris --only-source not-foo

testsuccessequal "$HEADER
$DOWNLOADNOTFOO" aptget source -q --print-uris src:not-foo

testsuccessequal "$HEADER
Picking 'foo' as source package instead of 'not-foo'
$DOWNLOADFOO" aptget source -q --print-uris not-foo

testsuccessequal "$HEADER
Picking 'foo' as source package instead of 'not-foo'
$DOWNLOADFOO" aptget source -q --print-uris not-foo:amd64

testsuccessequal "$HEADER
$DOWNLOADFOO" aptget source -q --print-uris --only-source foo

testsuccessequal "$HEADER
$DOWNLOADFOO" aptget source -q --print-uris src:foo

# Same dance with build-dep
testequal "$HEADER
Picking 'not-foo' as source package instead of 'foo'
$BUILDDEPNOTFOO" aptget build-dep -q -s foo

testequal "$HEADER
Picking 'not-foo' as source package instead of 'foo'
$BUILDDEPNOTFOO" aptget build-dep -q -s foo:amd64

testequal "$HEADER
$BUILDDEPNOTFOO" aptget build-dep -q -s --only-source not-foo

testequal "$HEADER
$BUILDDEPNOTFOO" aptget build-dep -q -s src:not-foo

testequal "$HEADER
Picking 'foo' as source package instead of 'not-foo'
$BUILDDEPFOO" aptget build-dep -q -s not-foo

testequal "$HEADER
Picking 'foo' as source package instead of 'not-foo'
$BUILDDEPFOO" aptget build-dep -q -s not-foo:amd64

testequal "$HEADER
$BUILDDEPFOO" aptget build-dep -q -s --only-source foo

testequal "$HEADER
$BUILDDEPFOO" aptget build-dep -q -s src:foo