]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-get-build-dep-file
test-acquire-same-file-multiple-times: Delete files before retrying
[apt.git] / test / integration / test-apt-get-build-dep-file
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture 'i386'
9
10 insertpackage 'stable' 'debhelper' 'i386' '7'
11 insertpackage 'stable' 'build-essential' 'i386' '1'
12 insertpackage 'stable' 'build-depends' 'i386' '1'
13 insertinstalledpackage 'build-conflict' 'i386' '1'
14
15 setupaptarchive
16
17 msgmsg 'Test with' 'unsigned dsc'
18 cat > 2vcard_0.5-3.dsc <<EOF
19 Format: 1.0
20 Source: 2vcard
21 Binary: 2vcard
22 Architecture: all
23 Version: 0.5-3
24 Maintainer: Martin Albisetti <argentina@gmail.com>
25 Uploaders: Marcela Tiznado <mlt@debian.org>
26 Standards-Version: 3.8.0
27 Build-Depends: debhelper (>= 5.0.37)
28 Build-Conflicts: build-conflict (<< 2)
29 Checksums-Sha1:
30 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
31 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
32 Checksums-Sha256:
33 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
34 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
35 Files:
36 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
37 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
38 EOF
39
40 test2vcardbuilddep() {
41 testsuccessequal "Note, using file './2vcard_0.5-3.dsc' to get the build dependencies
42 Reading package lists...
43 Building dependency tree...
44 The following packages will be REMOVED:
45 build-conflict
46 The following NEW packages will be installed:
47 build-essential debhelper
48 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
49 Remv build-conflict [1]
50 Inst build-essential (1 stable [i386])
51 Inst debhelper (7 stable [i386])
52 Conf build-essential (1 stable [i386])
53 Conf debhelper (7 stable [i386])" aptget build-dep -s ./2vcard_0.5-3.dsc
54 testfailure aptget build-dep --simulate 2vcard_0.5-3.dsc
55 cd downloaded
56 testsuccess aptget build-dep --simulate ../2vcard_0.5-3.dsc
57 testsuccess aptget build-dep --simulate "$(readlink -f ../2vcard_0.5-3.dsc)"
58 cd ..
59 }
60 test2vcardbuilddep
61
62 msgmsg 'Test with' 'signed dsc'
63 cat > 2vcard_0.5-3.dsc <<EOF
64 -----BEGIN PGP SIGNED MESSAGE-----
65 Hash: SHA1
66
67 Format: 1.0
68 Source: 2vcard
69 Binary: 2vcard
70 Architecture: all
71 Version: 0.5-3
72 Maintainer: Martin Albisetti <argentina@gmail.com>
73 Uploaders: Marcela Tiznado <mlt@debian.org>
74 Standards-Version: 3.8.0
75 Build-Depends: debhelper (>= 5.0.37)
76 Build-Conflicts: build-conflict (<< 2)
77 Checksums-Sha1:
78 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
79 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
80 Checksums-Sha256:
81 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
82 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
83 Files:
84 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
85 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
86
87 -----BEGIN PGP SIGNATURE-----
88 Version: GnuPG v1.4.9 (GNU/Linux)
89
90 iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
91 z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
92 =4eRd
93 -----END PGP SIGNATURE-----
94 EOF
95 test2vcardbuilddep
96
97
98 msgmsg 'Test with' 'unpacked source dir'
99 mkdir -p foo-1.0/debian
100 cat > foo-1.0/debian/control <<'EOF'
101 Source: apturl
102 Section: admin
103 Priority: optional
104 Maintainer: Michael Vogt <mvo@ubuntu.com>
105 Build-Depends: debhelper (>= 7)
106 X-Python3-Version: >= 3.2
107 Standards-Version: 3.9.3
108
109 Package: apturl-common
110 Architecture: any
111 Depends: ${python3:Depends},
112 ${shlibs:Depends},
113 ${misc:Depends},
114 python3-apt,
115 python3-update-manager
116 Replaces: apturl (<< 0.3.6ubuntu2)
117 Description: 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
126 EOF
127
128 testsuccessequal "Note, using directory './foo-1.0' to get the build dependencies
129 Reading package lists...
130 Building dependency tree...
131 The following NEW packages will be installed:
132 build-essential debhelper
133 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
134 Inst build-essential (1 stable [i386])
135 Inst debhelper (7 stable [i386])
136 Conf build-essential (1 stable [i386])
137 Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
138 testfailure aptget build-dep --simulate foo-1.0
139 cd downloaded
140 testsuccess aptget build-dep --simulate ../foo-1.0
141 testsuccess aptget build-dep --simulate "$(readlink -f ../foo-1.0)"
142 cd ..
143
144 testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep
145 testfailureequal 'E: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup' aptget build-dep --simulate ./foo-1.0 -a armel
146 testfailureequal 'Reading package lists...
147 E: Unable to find a source package for foo' aptget build-dep --simulate foo
148
149 msgmsg 'Test with a dsc' 'with comments'
150 cat > 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
155 Format: 3.0 (native)
156 Source: comments
157 Binary: comments
158 Architecture: all
159 Version: 1
160 #Version: 2
161 Maintainer: Joe Sixpack <joe@example.org>
162 Build-Depends: debhelper (>= 5),
163 # TODO: add more
164 build-depends (= 1),
165 Standards-Version: 3.9.6
166 # This is the end…
167
168 # or this?
169 EOF
170 testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
171 Reading package lists...
172 Building dependency tree...
173 The following NEW packages will be installed:
174 build-depends build-essential debhelper
175 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
176 Inst build-depends (1 stable [i386])
177 Inst build-essential (1 stable [i386])
178 Inst debhelper (7 stable [i386])
179 Conf build-depends (1 stable [i386])
180 Conf build-essential (1 stable [i386])
181 Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc
182 testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
183 Reading package lists...
184 Building dependency tree...
185 Execute external solver...
186 The following NEW packages will be installed:
187 build-depends build-essential debhelper
188 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
189 Inst build-depends (1 stable [i386])
190 Inst build-essential (1 stable [i386])
191 Inst debhelper (7 stable [i386])
192 Conf build-depends (1 stable [i386])
193 Conf build-essential (1 stable [i386])
194 Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc --solver apt