]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-build-dep-file
improve SOCKS error messages for http slightly
[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 ..
7414af7f 144
a249b3e6
DK
145testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep
146testfailureequal '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 147testfailureequal 'Reading package lists...
7414af7f 148E: Unable to find a source package for foo' aptget build-dep --simulate foo
e21ba628
DK
149
150msgmsg 'Test with a dsc' 'with comments'
151cat > comments.dsc <<EOF
152# I love comments
153# I love them so much, I give them their own paragraph
154
155#This is my first package
156Format: 3.0 (native)
157Source: comments
158Binary: comments
159Architecture: all
160Version: 1
161#Version: 2
162Maintainer: Joe Sixpack <joe@example.org>
163Build-Depends: debhelper (>= 5),
164# TODO: add more
165 build-depends (= 1),
166Standards-Version: 3.9.6
167# This is the end…
168
169# or this?
170EOF
a249b3e6
DK
171testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
172Reading package lists...
e21ba628 173Building dependency tree...
e21ba628
DK
174The following NEW packages will be installed:
175 build-depends build-essential debhelper
1760 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
177Inst build-depends (1 stable [i386])
178Inst build-essential (1 stable [i386])
179Inst debhelper (7 stable [i386])
180Conf build-depends (1 stable [i386])
181Conf build-essential (1 stable [i386])
182Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc
a249b3e6
DK
183testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
184Reading package lists...
185Building dependency tree...
186Execute external solver...
187The following NEW packages will be installed:
188 build-depends build-essential debhelper
1890 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
190Inst build-depends (1 stable [i386])
191Inst build-essential (1 stable [i386])
192Inst debhelper (7 stable [i386])
193Conf build-depends (1 stable [i386])
194Conf build-essential (1 stable [i386])
195Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc --solver apt