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