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