]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-build-dep-file
Don't download "optional" files not in Release :/.
[apt.git] / test / integration / test-apt-get-build-dep-file
CommitLineData
feab34c5
MV
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
feab34c5
MV
6
7setupenvironment
7414af7f 8configarchitecture 'i386'
feab34c5 9
7414af7f
DK
10insertpackage 'stable' 'debhelper' 'i386' '7'
11insertpackage 'stable' 'build-essential' 'i386' '1'
e21ba628 12insertpackage 'stable' 'build-depends' 'i386' '1'
b2fd8524 13insertsource 'stable' 'unrelated' 'any' '1'
7414af7f 14insertinstalledpackage 'build-conflict' 'i386' '1'
feab34c5
MV
15
16setupaptarchive
7414af7f
DK
17
18msgmsg 'Test with' 'unsigned dsc'
feab34c5
MV
19cat > 2vcard_0.5-3.dsc <<EOF
20Format: 1.0
21Source: 2vcard
22Binary: 2vcard
23Architecture: all
24Version: 0.5-3
25Maintainer: Martin Albisetti <argentina@gmail.com>
26Uploaders: Marcela Tiznado <mlt@debian.org>
27Standards-Version: 3.8.0
28Build-Depends: debhelper (>= 5.0.37)
7414af7f 29Build-Conflicts: build-conflict (<< 2)
feab34c5
MV
30Checksums-Sha1:
31 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
32 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
33Checksums-Sha256:
34 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
35 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
36Files:
37 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
38 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
39EOF
40
7414af7f 41test2vcardbuilddep() {
a249b3e6
DK
42 testsuccessequal "Note, using file './2vcard_0.5-3.dsc' to get the build dependencies
43Reading package lists...
feab34c5 44Building dependency tree...
7414af7f
DK
45The following packages will be REMOVED:
46 build-conflict
feab34c5
MV
47The following NEW packages will be installed:
48 build-essential debhelper
7414af7f
DK
490 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
50Remv build-conflict [1]
feab34c5
MV
51Inst build-essential (1 stable [i386])
52Inst debhelper (7 stable [i386])
53Conf build-essential (1 stable [i386])
f359b7e8
DK
54Conf debhelper (7 stable [i386])" aptget build-dep -s ./2vcard_0.5-3.dsc
55testfailure aptget build-dep --simulate 2vcard_0.5-3.dsc
56cd downloaded
57testsuccess aptget build-dep --simulate ../2vcard_0.5-3.dsc
58testsuccess aptget build-dep --simulate "$(readlink -f ../2vcard_0.5-3.dsc)"
59cd ..
7414af7f
DK
60}
61test2vcardbuilddep
feab34c5 62
7414af7f 63msgmsg 'Test with' 'signed dsc'
feab34c5
MV
64cat > 2vcard_0.5-3.dsc <<EOF
65-----BEGIN PGP SIGNED MESSAGE-----
66Hash: SHA1
67
68Format: 1.0
69Source: 2vcard
70Binary: 2vcard
71Architecture: all
72Version: 0.5-3
73Maintainer: Martin Albisetti <argentina@gmail.com>
74Uploaders: Marcela Tiznado <mlt@debian.org>
75Standards-Version: 3.8.0
76Build-Depends: debhelper (>= 5.0.37)
7414af7f 77Build-Conflicts: build-conflict (<< 2)
feab34c5
MV
78Checksums-Sha1:
79 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
80 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
81Checksums-Sha256:
82 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
83 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
84Files:
85 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
86 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
87
88-----BEGIN PGP SIGNATURE-----
89Version: GnuPG v1.4.9 (GNU/Linux)
90
91iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
92z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
93=4eRd
94-----END PGP SIGNATURE-----
95EOF
7414af7f 96test2vcardbuilddep
77da39b9
MV
97
98
7414af7f 99msgmsg 'Test with' 'unpacked source dir'
77da39b9
MV
100mkdir -p foo-1.0/debian
101cat > foo-1.0/debian/control <<'EOF'
102Source: apturl
103Section: admin
104Priority: optional
105Maintainer: Michael Vogt <mvo@ubuntu.com>
106Build-Depends: debhelper (>= 7)
107X-Python3-Version: >= 3.2
108Standards-Version: 3.9.3
109
110Package: apturl-common
111Architecture: any
112Depends: ${python3:Depends},
113 ${shlibs:Depends},
114 ${misc:Depends},
115 python3-apt,
116 python3-update-manager
117Replaces: apturl (<< 0.3.6ubuntu2)
118Description: install packages using the apt protocol - common data
119 AptUrl is a simple graphical application that takes an URL (which follows the
120 apt-protocol) as a command line option, parses it and carries out the
121 operations that the URL describes (that is, it asks the user if he wants the
122 indicated packages to be installed and if the answer is positive does so for
123 him).
124 .
125 This package contains the common data shared between the frontends.
126
127EOF
128
a249b3e6
DK
129testsuccessequal "Note, using directory './foo-1.0' to get the build dependencies
130Reading package lists...
77da39b9
MV
131Building dependency tree...
132The following NEW packages will be installed:
133 build-essential debhelper
1340 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
135Inst build-essential (1 stable [i386])
136Inst debhelper (7 stable [i386])
137Conf build-essential (1 stable [i386])
138Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
f359b7e8
DK
139testfailure aptget build-dep --simulate foo-1.0
140cd downloaded
141testsuccess aptget build-dep --simulate ../foo-1.0
142testsuccess aptget build-dep --simulate "$(readlink -f ../foo-1.0)"
143cd ..
ff02180c
DK
144cd foo-1.0
145testsuccess aptget build-dep --simulate './'
146testsuccess aptget build-dep --simulate '.'
147cd debian
148testsuccess aptget build-dep --simulate './../'
149testsuccess aptget build-dep --simulate '../'
150testsuccess aptget build-dep --simulate '..'
151cd ../..
7414af7f 152
a249b3e6
DK
153testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep
154testfailureequal 'E: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup' aptget build-dep --simulate ./foo-1.0 -a armel
7414af7f 155testfailureequal 'Reading package lists...
7414af7f 156E: Unable to find a source package for foo' aptget build-dep --simulate foo
e21ba628
DK
157
158msgmsg 'Test with a dsc' 'with comments'
159cat > comments.dsc <<EOF
160# I love comments
161# I love them so much, I give them their own paragraph
162
163#This is my first package
164Format: 3.0 (native)
165Source: comments
166Binary: comments
167Architecture: all
168Version: 1
169#Version: 2
170Maintainer: Joe Sixpack <joe@example.org>
171Build-Depends: debhelper (>= 5),
172# TODO: add more
173 build-depends (= 1),
174Standards-Version: 3.9.6
175# This is the end…
176
177# or this?
178EOF
a249b3e6
DK
179testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
180Reading package lists...
e21ba628 181Building dependency tree...
e21ba628
DK
182The following NEW packages will be installed:
183 build-depends build-essential debhelper
1840 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
185Inst build-depends (1 stable [i386])
186Inst build-essential (1 stable [i386])
187Inst debhelper (7 stable [i386])
188Conf build-depends (1 stable [i386])
189Conf build-essential (1 stable [i386])
190Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc
a249b3e6
DK
191testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
192Reading package lists...
193Building dependency tree...
194Execute external solver...
195The following NEW packages will be installed:
196 build-depends build-essential debhelper
1970 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
198Inst build-depends (1 stable [i386])
199Inst build-essential (1 stable [i386])
200Inst debhelper (7 stable [i386])
201Conf build-depends (1 stable [i386])
202Conf build-essential (1 stable [i386])
203Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc --solver apt