Merge ~racb/git-ubuntu:core20 into git-ubuntu:master
- Git
- lp:~racb/git-ubuntu
- core20
- Merge into master
Status: | Merged |
---|---|
Merged at revision: | 7b156d318055f4b683c4c3c3a000b9876a56f0a2 |
Proposed branch: | ~racb/git-ubuntu:core20 |
Merge into: | git-ubuntu:master |
Diff against target: |
1566 lines (+389/-618) 36 files modified
bin/self-test (+29/-16) debian/bash-completion (+1/-0) debian/changelog (+5/-0) debian/control (+38/-0) debian/copyright (+6/-0) debian/extra/git-ubuntu.self-test (+3/-0) debian/install (+9/-0) debian/manpages (+1/-0) debian/py3dist-overrides (+2/-0) debian/rules (+4/-0) debian/source/format (+1/-0) debian/tests/control (+2/-0) dev/null (+0/-18) gitubuntu/__main__.py (+2/-12) gitubuntu/build.py (+4/-12) gitubuntu/clone.py (+2/-8) gitubuntu/dsc.py (+1/-6) gitubuntu/exportorig.py (+1/-6) gitubuntu/git_repository.py (+16/-22) gitubuntu/importer.py (+14/-19) gitubuntu/importer_test.py (+19/-3) gitubuntu/rich_history.py (+2/-2) gitubuntu/source_builder_test.py (+2/-1) gitubuntu/source_information.py (+7/-15) gitubuntu/submit.py (+1/-6) gitubuntu/test_fixtures.py (+21/-0) gitubuntu/versioning.py (+5/-11) setup.py (+1/-0) snap-wrappers/wrappers/gbp (+1/-7) snap-wrappers/wrappers/git-ubuntu (+1/-1) snap-wrappers/wrappers/merge-changelogs (+3/-0) snap-wrappers/wrappers/quilt (+1/-6) snap-wrappers/wrappers/reconstruct-changelog (+3/-0) snap-wrappers/wrappers/self-test (+3/-0) snap.sh (+101/-0) snap/snapcraft.yaml (+77/-447) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Bryce Harrington | Approve | ||
Review via email: mp+399511@code.launchpad.net |
Commit message
Make Jenkins happy
Description of the change
This branch is unlikely to initially pass CI as the CI build and test scripts will need to be fixed first to work against it.
Robie Basak (racb) wrote : | # |
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:80dd55aadfb
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:80dd55aadfb
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:70305eb4eb3
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Bryce Harrington (bryce) wrote : | # |
This looks great! A few minor comments/questions below but not really anything substantial. You know I love patches that have more removal than addition, and being able to build this as a deb will be awesome.
I had meant to play with building this manually but have no doubt it works and am unfortunately running against EOD; I'm sure I'll get a chance some day, so no worries.
The one notable piece is the snap.sh's big warning comment about it being destructive to the host. If you're actually worried someone might run it (it's in the root of the repository after all), you might have it echo that message to stderr prior to the sudo prompt. It doesn't sound to me like it would be irreversibly destructive, just that it modifies apt and installs some things.
Anyway, nice work, looking forward to seeing this go in. :-)
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:bc6b4fa5e0e
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:de874618561
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Preview Diff
1 | diff --git a/snap-wrappers/wrappers/git-ubuntu-self-test b/bin/self-test |
2 | similarity index 83% |
3 | rename from snap-wrappers/wrappers/git-ubuntu-self-test |
4 | rename to bin/self-test |
5 | index d5f1bda..e7ae13a 100755 |
6 | --- a/snap-wrappers/wrappers/git-ubuntu-self-test |
7 | +++ b/bin/self-test |
8 | @@ -1,4 +1,4 @@ |
9 | -#!/snap/git-ubuntu/current/bin/bash |
10 | +#!/bin/bash |
11 | |
12 | function die() { |
13 | echo "Error: ${*}" 1>&2 |
14 | @@ -57,10 +57,14 @@ snap_run() { |
15 | $exec snap run --shell "$snap" -c 'exec "$0" "$@"' "$@" |
16 | } |
17 | |
18 | -if [ -n "$SNAP" -a -z "$TEST_TREE" ]; then |
19 | - pkg_dir=${SNAP}/lib/python3.6/site-packages |
20 | - snap_bin_dir="${SNAP}/bin" |
21 | - pylintrc_path="${SNAP}/etc/pylintrc" |
22 | +if [ -n "$TEST_SYSTEM_TREE" ]; then |
23 | + pkg_dir=$(dirname $(python3 -c 'import gitubuntu; print(gitubuntu.__path__[0])')) |
24 | + snap_bin_glob=/usr/bin/git-ubuntu.* |
25 | + pylintrc_path=/usr/share/git-ubuntu/pylintrc |
26 | +elif [ -n "$SNAP" -a -z "$TEST_TREE" ]; then |
27 | + pkg_dir=${SNAP}/usr/lib/python3/dist-packages |
28 | + snap_bin_glob="${SNAP}/usr/bin/git-ubuntu.*" |
29 | + pylintrc_path="${SNAP}/usr/share/git-ubuntu/pylintrc" |
30 | [ -d "$pkg_dir" ] || |
31 | { error "$pkg_dir is not a directory"; exit 1; } |
32 | else |
33 | @@ -86,7 +90,7 @@ else |
34 | snap_run --exec git-ubuntu "$0" "$@" |
35 | fi |
36 | pkg_dir=$( cd "${TEST_TREE%/}" && pwd ) |
37 | - snap_bin_dir="${pkg_dir}/bin" |
38 | + snap_bin_glob="${pkg_dir}/bin/*.py" |
39 | pylintrc_path="$TEST_TREE/.pylintrc" |
40 | fi |
41 | |
42 | @@ -103,7 +107,11 @@ cd "${pkg_dir}" \ |
43 | ln -s "${pkg_dir}/gitubuntu" "${tmp_dir}" \ |
44 | || die "Could not create link to gitubuntu module in ${tmp_dir}" |
45 | |
46 | -error "Inside git-ubuntu snap $SNAP_REVISION/$SNAP_VERSION." |
47 | +if [ -n "$TEST_SYSTEM_TREE" ]; then |
48 | + error "Testing git-ubuntu system installation." |
49 | +else |
50 | + error "Inside git-ubuntu snap $SNAP_REVISION/$SNAP_VERSION." |
51 | +fi |
52 | error "Testing tree in $pkg_dir/gitubuntu" |
53 | error "Working dir $PWD" |
54 | |
55 | @@ -113,17 +121,22 @@ function cleanup() { |
56 | } |
57 | trap cleanup EXIT |
58 | |
59 | -# Check dependencies are installed |
60 | -if python3 -m pip check |
61 | -then |
62 | - echo "pip3 found all required dependencies" |
63 | -else |
64 | - echo "pip check failed; self test will fail" |
65 | - retval=1 |
66 | +if [ -z "$TEST_SYSTEM_TREE" ]; then |
67 | + # Check dependencies are installed |
68 | + if python3 -m pip check |
69 | + then |
70 | + echo "pip3 found all required dependencies" |
71 | + else |
72 | + echo "pip check failed; self test will fail" |
73 | + retval=1 |
74 | + fi |
75 | fi |
76 | |
77 | # Style check python modules |
78 | -if python3 -m pylint --rcfile "$pylintrc_path" -E gitubuntu/ |
79 | +# For some reason, pylint hangs indefinitely if used without a -j option (the |
80 | +# default is two) in the multiprocessing module. As a workaround for now, we |
81 | +# specify -j1, which seems to work. |
82 | +if python3 -m pylint --rcfile "$pylintrc_path" -E gitubuntu/ -j1 |
83 | then |
84 | echo "pylint passed!" |
85 | else |
86 | @@ -172,7 +185,7 @@ while IFS= read -r -d '' script_source; do |
87 | else |
88 | echo "SKIP (compilation) ${script}" |
89 | fi |
90 | -done < <(find "${snap_bin_dir}" -name "*.py" -print0) |
91 | +done < <(compgen -G "$snap_bin_glob") |
92 | |
93 | # Run the unit testsuite |
94 | if COVERAGE_FILE="${tmp_dir}/coverage.txt" python3 -m pytest -p no:cacheprovider --cov=gitubuntu gitubuntu/* |
95 | diff --git a/debian/bash-completion b/debian/bash-completion |
96 | new file mode 100644 |
97 | index 0000000..7c42e96 |
98 | --- /dev/null |
99 | +++ b/debian/bash-completion |
100 | @@ -0,0 +1 @@ |
101 | +doc/gitubuntu-completion.sh |
102 | diff --git a/debian/changelog b/debian/changelog |
103 | new file mode 100644 |
104 | index 0000000..24c1a2d |
105 | --- /dev/null |
106 | +++ b/debian/changelog |
107 | @@ -0,0 +1,5 @@ |
108 | +git-ubuntu (0) UNRELEASED; urgency=medium |
109 | + |
110 | + * Initial packaging. |
111 | + |
112 | + -- Robie Basak <robie.basak@ubuntu.com> Thu, 11 Mar 2021 15:23:18 +0000 |
113 | diff --git a/debian/control b/debian/control |
114 | new file mode 100644 |
115 | index 0000000..6ad0540 |
116 | --- /dev/null |
117 | +++ b/debian/control |
118 | @@ -0,0 +1,38 @@ |
119 | +Source: git-ubuntu |
120 | +Section: devel |
121 | +Priority: optional |
122 | +Standards-Version: 4.5.1 |
123 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
124 | +Build-Depends: bash-completion, |
125 | + debhelper-compat (= 12), |
126 | + debian-archive-keyring, |
127 | + dh-exec, |
128 | + dh-python, |
129 | + git, |
130 | + git-buildpackage, |
131 | + pristine-tar, |
132 | + python3 (>= 3.6), |
133 | + python3-cachetools, |
134 | + python3-keyring, |
135 | + python3-keyrings.alt, |
136 | + python3-petname, |
137 | + python3-pygit2, |
138 | + python3-pytest, |
139 | + python3-setuptools, |
140 | + python3-systemd, |
141 | + python3-ubuntutools, |
142 | + python3-zmq, |
143 | + quilt, |
144 | + ubuntu-keyring |
145 | + |
146 | +Package: git-ubuntu |
147 | +Architecture: all |
148 | +Depends: debian-archive-keyring, |
149 | + git, |
150 | + git-buildpackage, |
151 | + pristine-tar, |
152 | + quilt, |
153 | + ubuntu-keyring, |
154 | + ${misc:Depends}, |
155 | + ${python3:Depends} |
156 | +Description: maintain an Ubuntu source package in a git tree |
157 | diff --git a/debian/copyright b/debian/copyright |
158 | new file mode 100644 |
159 | index 0000000..f3e8a64 |
160 | --- /dev/null |
161 | +++ b/debian/copyright |
162 | @@ -0,0 +1,6 @@ |
163 | +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
164 | +Upstream-Contact: ubuntu-devel-discuss@lists.ubuntu.com |
165 | + |
166 | +Files: * |
167 | +Copyright: 2014-2021 Canonical Ltd |
168 | +License: GPLv3 |
169 | diff --git a/debian/extra/git-ubuntu.self-test b/debian/extra/git-ubuntu.self-test |
170 | new file mode 100755 |
171 | index 0000000..2d60632 |
172 | --- /dev/null |
173 | +++ b/debian/extra/git-ubuntu.self-test |
174 | @@ -0,0 +1,3 @@ |
175 | +#!/bin/sh |
176 | + |
177 | +TEST_SYSTEM_TREE=1 exec /usr/share/git-ubuntu/self-test "$@" |
178 | diff --git a/debian/install b/debian/install |
179 | new file mode 100755 |
180 | index 0000000..e150a16 |
181 | --- /dev/null |
182 | +++ b/debian/install |
183 | @@ -0,0 +1,9 @@ |
184 | +#!/usr/bin/dh-exec |
185 | +.pylintrc => usr/share/git-ubuntu/pylintrc |
186 | +bin/git-merge-changelogs => usr/bin/git-ubuntu.merge-changelogs |
187 | +bin/git-reconstruct-changelog => usr/bin/git-ubuntu.reconstruct-changelog |
188 | +bin/import-source-packages.py => usr/bin/git-ubuntu.import-source-packages |
189 | +bin/self-test => usr/share/git-ubuntu/self-test |
190 | +bin/source-package-walker.py => usr/bin/git-ubuntu.source-package-walker |
191 | +bin/update-repository-alias.py => usr/bin/git-ubuntu.update-repository-alias |
192 | +debian/extra/git-ubuntu.self-test => usr/bin/git-ubuntu.self-test |
193 | diff --git a/debian/manpages b/debian/manpages |
194 | new file mode 100644 |
195 | index 0000000..8a47eba |
196 | --- /dev/null |
197 | +++ b/debian/manpages |
198 | @@ -0,0 +1 @@ |
199 | +man/man1/*.1 |
200 | diff --git a/debian/py3dist-overrides b/debian/py3dist-overrides |
201 | new file mode 100644 |
202 | index 0000000..32f925e |
203 | --- /dev/null |
204 | +++ b/debian/py3dist-overrides |
205 | @@ -0,0 +1,2 @@ |
206 | +zmq python3-zmq |
207 | +ubuntutools python3-ubuntutools |
208 | diff --git a/debian/rules b/debian/rules |
209 | new file mode 100755 |
210 | index 0000000..d602341 |
211 | --- /dev/null |
212 | +++ b/debian/rules |
213 | @@ -0,0 +1,4 @@ |
214 | +#!/usr/bin/make -f |
215 | + |
216 | +%: |
217 | + dh $@ --with bash-completion,python3 --buildsystem=pybuild |
218 | diff --git a/debian/source/format b/debian/source/format |
219 | new file mode 100644 |
220 | index 0000000..89ae9db |
221 | --- /dev/null |
222 | +++ b/debian/source/format |
223 | @@ -0,0 +1 @@ |
224 | +3.0 (native) |
225 | diff --git a/debian/tests/control b/debian/tests/control |
226 | new file mode 100644 |
227 | index 0000000..4e00487 |
228 | --- /dev/null |
229 | +++ b/debian/tests/control |
230 | @@ -0,0 +1,2 @@ |
231 | +Test-Command: git-ubuntu.self-test |
232 | +Restrictions: allow-stderr |
233 | diff --git a/gitubuntu/__main__.py b/gitubuntu/__main__.py |
234 | index 4bf96c1..0ad68bf 100644 |
235 | --- a/gitubuntu/__main__.py |
236 | +++ b/gitubuntu/__main__.py |
237 | @@ -4,12 +4,7 @@ from collections import namedtuple |
238 | import logging |
239 | import sys |
240 | |
241 | -try: |
242 | - pkg = 'python3-pkg-resources' |
243 | - import pkg_resources |
244 | -except: |
245 | - logging.error('Is %s installed?', pkg) |
246 | - sys.exit(1) |
247 | +import pkg_resources |
248 | |
249 | TopLevelDefaults = namedtuple( |
250 | 'TopLevelDefaults', |
251 | @@ -67,12 +62,7 @@ def main(): |
252 | import textwrap |
253 | from gitubuntu.run import run |
254 | |
255 | - try: |
256 | - pkg = 'python3-argcomplete' |
257 | - import argcomplete |
258 | - except: |
259 | - logging.error('Is %s installed?', pkg) |
260 | - sys.exit(1) |
261 | + import argcomplete |
262 | |
263 | logging.getLogger('keyring').setLevel(logging.WARNING) |
264 | |
265 | diff --git a/gitubuntu/build.py b/gitubuntu/build.py |
266 | index ab2467f..4606a6c 100644 |
267 | --- a/gitubuntu/build.py |
268 | +++ b/gitubuntu/build.py |
269 | @@ -46,18 +46,10 @@ from gitubuntu.source_information import ( |
270 | derive_codename_from_series, |
271 | ) |
272 | from gitubuntu.test_util import get_test_changelog |
273 | -try: |
274 | - pkg = 'python3-debian' |
275 | - from debian.debfile import PART_EXTS |
276 | - pkg = 'python3-petname' |
277 | - import petname |
278 | - pkg = 'python3-pygit2' |
279 | - import pygit2 |
280 | - pkg = 'python3-pytest' |
281 | - import pytest |
282 | -except ImportError: |
283 | - logging.error('Is %s installed?', pkg) |
284 | - sys.exit(1) |
285 | +from debian.debfile import PART_EXTS |
286 | +import petname |
287 | +import pygit2 |
288 | +import pytest |
289 | |
290 | from distro_info import DebianDistroInfo, UbuntuDistroInfo |
291 | |
292 | diff --git a/gitubuntu/clone.py b/gitubuntu/clone.py |
293 | index 0eca56e..2e0d48d 100644 |
294 | --- a/gitubuntu/clone.py |
295 | +++ b/gitubuntu/clone.py |
296 | @@ -12,14 +12,8 @@ from gitubuntu.git_repository import ( |
297 | ) |
298 | from gitubuntu.run import decode_binary, run |
299 | |
300 | -try: |
301 | - pkg = 'python3-pkg-resources' |
302 | - import pkg_resources |
303 | - pkg = 'python3-pygit2' |
304 | - import pygit2 |
305 | -except ImportError: |
306 | - logging.error('Is %s installed?', pkg) |
307 | - sys.exit(1) |
308 | +import pkg_resources |
309 | +import pygit2 |
310 | |
311 | def copy_hooks(src, dst): |
312 | try: |
313 | diff --git a/gitubuntu/dsc.py b/gitubuntu/dsc.py |
314 | index 1fc3129..786b744 100644 |
315 | --- a/gitubuntu/dsc.py |
316 | +++ b/gitubuntu/dsc.py |
317 | @@ -2,12 +2,7 @@ import logging |
318 | import os |
319 | import re |
320 | import sys |
321 | -try: |
322 | - pkg = 'python3-ubuntutools' |
323 | - from ubuntutools.archive import Dsc |
324 | -except ImportError: |
325 | - logging.error('Is %s installed?', pkg) |
326 | - sys.exit(1) |
327 | +from ubuntutools.archive import Dsc |
328 | |
329 | orig_re = re.compile(r'.*\.orig\.tar\.[^.]+$') |
330 | component_re = re.compile(r'^(?P<pkgname>.*)_(?P<version>.*)\.orig-(?P<component>[^.]+)\.tar\.[^.]+$') |
331 | diff --git a/gitubuntu/exportorig.py b/gitubuntu/exportorig.py |
332 | index a04362c..be4ded2 100644 |
333 | --- a/gitubuntu/exportorig.py |
334 | +++ b/gitubuntu/exportorig.py |
335 | @@ -6,12 +6,7 @@ import gitubuntu.build |
336 | from gitubuntu.cache import CACHE_PATH |
337 | import gitubuntu.git_repository |
338 | |
339 | -try: |
340 | - pkg = 'python3-pygit2' |
341 | - import pygit2 |
342 | -except ImportError: |
343 | - logging.error('Is %s installed?', pkg) |
344 | - sys.exit(1) |
345 | +import pygit2 |
346 | |
347 | def parse_args(subparsers=None, base_subparsers=None): |
348 | kwargs = dict( |
349 | diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py |
350 | index 2cfdf9a..8dc4d1f 100644 |
351 | --- a/gitubuntu/git_repository.py |
352 | +++ b/gitubuntu/git_repository.py |
353 | @@ -31,17 +31,10 @@ from gitubuntu.run import ( |
354 | import gitubuntu.spec |
355 | from gitubuntu.test_util import get_test_changelog |
356 | import gitubuntu.versioning |
357 | -try: |
358 | - pkg = 'python3-debian' |
359 | - import debian.changelog |
360 | - import debian.debian_support |
361 | - pkg = 'python3-pygit2' |
362 | - import pygit2 |
363 | - pkg = 'python3-pytest' |
364 | - import pytest |
365 | -except ImportError: |
366 | - logging.error('Is %s installed?', pkg) |
367 | - sys.exit(1) |
368 | +import debian.changelog |
369 | +import debian.debian_support |
370 | +import pygit2 |
371 | +import pytest |
372 | |
373 | |
374 | def _follow_symlinks_to_blob(repo, top_tree_object, search_path, |
375 | @@ -72,7 +65,7 @@ def _follow_symlinks_to_blob(repo, top_tree_object, search_path, |
376 | tail = None |
377 | |
378 | entry = _rel_tree[head] |
379 | - if entry.type == 'tree': |
380 | + if entry.type in [pygit2.GIT_OBJ_TREE, 'tree']: |
381 | return _follow_symlinks_to_blob( |
382 | repo=repo, |
383 | top_tree_object=top_tree_object, |
384 | @@ -80,7 +73,7 @@ def _follow_symlinks_to_blob(repo, top_tree_object, search_path, |
385 | _rel_tree=repo.get(entry.id), |
386 | _rel_path=posixpath.join(_rel_path, head), |
387 | ) |
388 | - elif entry.type == 'blob' and entry.filemode == pygit2.GIT_FILEMODE_LINK: |
389 | + elif entry.type in [pygit2.GIT_OBJ_BLOB, 'blob'] and entry.filemode == pygit2.GIT_FILEMODE_LINK: |
390 | # Found a symlink. Start again from the top with adjustment for symlink |
391 | # following |
392 | target_tail = [decode_binary(repo.get(entry.id).data)] |
393 | @@ -94,7 +87,7 @@ def _follow_symlinks_to_blob(repo, top_tree_object, search_path, |
394 | top_tree_object=top_tree_object, |
395 | search_path=search_path, |
396 | ) |
397 | - elif entry.type == 'blob' and entry.filemode in NORMAL_BLOB_MODES: |
398 | + elif entry.type in [pygit2.GIT_OBJ_BLOB, 'blob'] and entry.filemode in NORMAL_BLOB_MODES: |
399 | return repo.get(entry.id) |
400 | else: |
401 | # Found some special entry such as a "gitlink" (submodule entry) |
402 | @@ -591,7 +584,7 @@ class Changelog: |
403 | @property |
404 | def _shell_version(self): |
405 | parse_params = '-n1 -SVersion' |
406 | - shell_cmd = 'grep -m1 \'^\S\' | sed \'s/.*(\(.*\)).*/\\1/\'' |
407 | + shell_cmd = "grep -m1 '^\\S' | sed 's/.*(\\(.*\\)).*/\\1/'" |
408 | try: |
409 | raw_out = self._dpkg_parsechangelog(parse_params) |
410 | except CalledProcessError: |
411 | @@ -627,7 +620,7 @@ class Changelog: |
412 | @property |
413 | def _shell_previous_version(self): |
414 | parse_params = '-n1 -o1 -SVersion' |
415 | - shell_cmd = 'grep -m1 \'^\S\' | tail -1 | sed \'s/.*(\(.*\)).*/\\1/\'' |
416 | + shell_cmd = "grep -m1 '^\\S' | tail -1 | sed 's/.*(\\(.*\\)).*/\\1/'" |
417 | try: |
418 | raw_out = self._dpkg_parsechangelog(parse_params) |
419 | except CalledProcessError: |
420 | @@ -652,7 +645,7 @@ class Changelog: |
421 | @property |
422 | def _shell_maintainer(self): |
423 | parse_params = '-SMaintainer' |
424 | - shell_cmd = 'grep -m1 \'^ --\' | sed \'s/ -- \(.*\) \(.*\)/\\1/\'' |
425 | + shell_cmd = "grep -m1 '^ --' | sed 's/ -- \\(.*\\) \\(.*\\)/\\1/'" |
426 | try: |
427 | return self._dpkg_parsechangelog(parse_params) |
428 | except CalledProcessError: |
429 | @@ -676,7 +669,7 @@ class Changelog: |
430 | @property |
431 | def _shell_date(self): |
432 | parse_params = '-SDate' |
433 | - shell_cmd = 'grep -m1 \'^ --\' | sed \'s/ -- \(.*\) \(.*\)/\\2/\'' |
434 | + shell_cmd = "grep -m1 '^ --' | sed 's/ -- \\(.*\\) \\(.*\\)/\\2/'" |
435 | try: |
436 | return self._dpkg_parsechangelog(parse_params) |
437 | except CalledProcessError: |
438 | @@ -697,7 +690,7 @@ class Changelog: |
439 | @property |
440 | def _shell_all_versions(self): |
441 | parse_params = '--format rfc822 -SVersion --all' |
442 | - shell_cmd = 'grep \'^\S\' | sed \'s/.*(\(.*\)).*/\\1/\'' |
443 | + shell_cmd = "grep '^\\S' | sed 's/.*(\\(.*\\)).*/\\1/'" |
444 | try: |
445 | version_lines = self._dpkg_parsechangelog(parse_params) |
446 | except CalledProcessError: |
447 | @@ -734,7 +727,7 @@ class Changelog: |
448 | @property |
449 | def _shell_distribution(self): |
450 | parse_params = '-SDistribution' |
451 | - shell_cmd = 'grep -m1 \'^\S\' | sed \'s/.*\ .*\ \(.*\);.*/\\1/\'' |
452 | + shell_cmd = "grep -m1 '^\\S' | sed 's/.*\\ .*\\ \\(.*\\);.*/\\1/'" |
453 | try: |
454 | return self._dpkg_parsechangelog(parse_params) |
455 | except CalledProcessError: |
456 | @@ -755,7 +748,7 @@ class Changelog: |
457 | @property |
458 | def _shell_srcpkg(self): |
459 | parse_params = '-SSource' |
460 | - shell_cmd = 'grep -m1 \'^\S\' | sed \'s/\(.*\)\ .*\ .*;.*/\\1/\'' |
461 | + shell_cmd = "grep -m1 '^\\S' | sed 's/\\(.*\\)\\ .*\\ .*;.*/\\1/'" |
462 | try: |
463 | return self._dpkg_parsechangelog(parse_params) |
464 | except CalledProcessError: |
465 | @@ -1095,7 +1088,8 @@ class GitUbuntuRepository: |
466 | # (for example in deriving the environment to use for calls to the git |
467 | # CLI). This permits the behaviour to remain identical for now. |
468 | # Eventually we can break previous behaviour and eliminate the need for |
469 | - # this. |
470 | + # this. See also: gitubuntu.test_fixtures.repo; the handling of EMAIL |
471 | + # there could be made cleaner when this is cleaned up. |
472 | self._initial_env = os.environ.copy() |
473 | |
474 | self.set_git_attributes() |
475 | diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py |
476 | index b2a9916..26908cb 100644 |
477 | --- a/gitubuntu/importer.py |
478 | +++ b/gitubuntu/importer.py |
479 | @@ -71,14 +71,8 @@ from gitubuntu.source_information import ( |
480 | import gitubuntu.spec as spec |
481 | from gitubuntu.version import VERSION |
482 | from gitubuntu.versioning import version_compare |
483 | -try: |
484 | - pkg = 'python3-pygit2' |
485 | - import pygit2 |
486 | - pkg = 'python3-lazr.restfulclient' |
487 | - from lazr.restfulclient.errors import NotFound, PreconditionFailed |
488 | -except ImportError: |
489 | - logging.error('Is %s installed?', pkg) |
490 | - sys.exit(1) |
491 | +import pygit2 |
492 | +from lazr.restfulclient.errors import NotFound, PreconditionFailed |
493 | |
494 | |
495 | class GitUbuntuImportError(Exception): |
496 | @@ -844,7 +838,7 @@ def import_patches_applied_tree(repo, dsc_pathname): |
497 | |
498 | try: |
499 | if not is_dir_3_0_quilt(extracted_dir): |
500 | - raise StopIteration() |
501 | + return |
502 | |
503 | while True: |
504 | try: |
505 | @@ -906,7 +900,7 @@ def import_patches_applied_tree(repo, dsc_pathname): |
506 | # quilt returns 2 when done pushing |
507 | if e.returncode != 2: |
508 | raise |
509 | - raise StopIteration() |
510 | + return |
511 | finally: |
512 | os.chdir(oldcwd) |
513 | shutil.rmtree(extract_dir) |
514 | @@ -1193,7 +1187,7 @@ def update_devel_branches( |
515 | series_name_list=ubuntu_sinfo.all_series_name_list, |
516 | ): |
517 | if commit is None: |
518 | - logging.warn( |
519 | + logging.warning( |
520 | "Source package '%s' does not appear to have been published " |
521 | "in Ubuntu. No %s created.", |
522 | pkgname, |
523 | @@ -1509,7 +1503,7 @@ def validate_upload_tag( |
524 | :returns: True if the upload tag validates; False otherwise. |
525 | """ |
526 | if upload_tag.peel().tree.id != import_tree.id: |
527 | - logging.warn( |
528 | + logging.warning( |
529 | "Found upload tag %s, but the corresponding tree " |
530 | "does not match the published version. Will import %s as " |
531 | "normal, ignoring the upload tag.", |
532 | @@ -1526,7 +1520,7 @@ def validate_upload_tag( |
533 | for commit in changelog_parents |
534 | ) |
535 | if not has_changelog_parent_ancestor: |
536 | - logging.warn( |
537 | + logging.warning( |
538 | "Found upload tag %s, but no changelog parent is its ancestor. " |
539 | "Will import %s as normal, ignoring the upload tag.", |
540 | repo.tag_to_pretty_name(upload_tag), |
541 | @@ -1999,9 +1993,7 @@ def import_applied_dsc( |
542 | if repo.treeishs_identical( |
543 | unapplied_import_tree_hash, str(applied_tip_head.peel().id) |
544 | ): |
545 | - logging.warn('%s is identical to %s', |
546 | - pretty_head_name, version |
547 | - ) |
548 | + logging.warning('%s is identical to %s', pretty_head_name, version) |
549 | return |
550 | applied_tip_version, _ = repo.get_changelog_versions_from_treeish( |
551 | str(applied_tip_head.peel().id), |
552 | @@ -2025,9 +2017,12 @@ def import_applied_dsc( |
553 | ) |
554 | else: |
555 | if version_compare(version, applied_tip_version) <= 0: |
556 | - logging.warn('Version to import (%s) is not after %s tip (%s)', |
557 | - version, pretty_head_name, applied_tip_version |
558 | - ) |
559 | + logging.warning( |
560 | + 'Version to import (%s) is not after %s tip (%s)', |
561 | + version, |
562 | + pretty_head_name, |
563 | + applied_tip_version, |
564 | + ) |
565 | |
566 | |
567 | applied_changelog_parent_commits = get_changelog_parent_commits( |
568 | diff --git a/gitubuntu/importer_test.py b/gitubuntu/importer_test.py |
569 | index b09b71c..1848d76 100644 |
570 | --- a/gitubuntu/importer_test.py |
571 | +++ b/gitubuntu/importer_test.py |
572 | @@ -1141,7 +1141,12 @@ def MockSPI(dsc_path, version): |
573 | spi.dsc_pathname = dsc_path |
574 | spi.distribution_name = 'Ubuntu' |
575 | spi.version = version |
576 | - spi.date_created = datetime.datetime(1970, 1, 1) |
577 | + spi.date_created = datetime.datetime( |
578 | + 1970, |
579 | + 1, |
580 | + 1, |
581 | + tzinfo=datetime.timezone.utc, |
582 | + ) |
583 | head_name = Mock(name='head_name') |
584 | head_name.return_value = 'importer/ubuntu/trusty' |
585 | spi.head_name = head_name |
586 | @@ -1795,7 +1800,15 @@ def test_authorship_date(repo, override, input_string, expected_result): |
587 | head_name='ubuntu/focal', |
588 | skip_orig=True, |
589 | parent_overrides={}, |
590 | - commit_date=datetime.datetime(1972, 3, 3, 12, 45, 57), |
591 | + commit_date=datetime.datetime( |
592 | + 1972, |
593 | + 3, |
594 | + 3, |
595 | + 12, |
596 | + 45, |
597 | + 57, |
598 | + tzinfo=datetime.timezone.utc, |
599 | + ), |
600 | changelog_date_overrides=( |
601 | frozenset({'1-1'}) if override else frozenset() |
602 | ), |
603 | @@ -1805,6 +1818,9 @@ def test_authorship_date(repo, override, input_string, expected_result): |
604 | ) |
605 | commit = import_ref.peel(pygit2.Commit) |
606 | assert commit.author.time == int( |
607 | - datetime.datetime(*expected_result[:6]).timestamp() |
608 | + datetime.datetime( |
609 | + *expected_result[:6], |
610 | + tzinfo=datetime.timezone.utc, |
611 | + ).timestamp() |
612 | ) |
613 | assert commit.author.offset == expected_result[6] |
614 | diff --git a/gitubuntu/rich_history.py b/gitubuntu/rich_history.py |
615 | index b987b46..1ca61e0 100644 |
616 | --- a/gitubuntu/rich_history.py |
617 | +++ b/gitubuntu/rich_history.py |
618 | @@ -140,9 +140,9 @@ def export_all(repo, path, namespace='importer'): |
619 | try: |
620 | export_upload_tag(repo, path, ref, commit_map) |
621 | except MultipleParentError: |
622 | - logging.warn("Multiple parents exporting %s" % ref.name) |
623 | + logging.warning("Multiple parents exporting %s" % ref.name) |
624 | except BaseNotFoundError: |
625 | - logging.warn("No base found exporting %s" % ref.name) |
626 | + logging.warning("No base found exporting %s" % ref.name) |
627 | |
628 | |
629 | def import_single(repo, path, version, namespace='importer'): |
630 | diff --git a/gitubuntu/source_builder_test.py b/gitubuntu/source_builder_test.py |
631 | index 9131a98..ab36985 100644 |
632 | --- a/gitubuntu/source_builder_test.py |
633 | +++ b/gitubuntu/source_builder_test.py |
634 | @@ -2,6 +2,7 @@ import os |
635 | import subprocess |
636 | import tempfile |
637 | |
638 | +import pygit2 |
639 | import pytest |
640 | |
641 | import gitubuntu.source_builder as target |
642 | @@ -140,7 +141,7 @@ def test_source_quilt_no_patches(repo): |
643 | with target.Source(target.SourceSpec()) as dsc_path: |
644 | top = dsc_path_to_tree(repo, dsc_path) |
645 | debian_entry = top['debian'] |
646 | - assert debian_entry.type == 'tree' |
647 | + assert debian_entry.type in [pygit2.GIT_OBJ_TREE, 'tree'] |
648 | debian = repo.raw_repo.get(debian_entry.id) |
649 | with pytest.raises(KeyError): |
650 | debian['patches'] |
651 | diff --git a/gitubuntu/source_information.py b/gitubuntu/source_information.py |
652 | index cf729b8..3cc11e7 100644 |
653 | --- a/gitubuntu/source_information.py |
654 | +++ b/gitubuntu/source_information.py |
655 | @@ -10,20 +10,12 @@ _LP_LOGIN_AUTH = None |
656 | _lp_service = 'production' |
657 | _lp_api_version = 'devel' |
658 | |
659 | -try: |
660 | - pkg = 'python3-cachetools' |
661 | - import cachetools |
662 | - pkg = 'python3-distro-info' |
663 | - from distro_info import DebianDistroInfo, UbuntuDistroInfo |
664 | - pkg = 'python3-launchpadlib' |
665 | - from launchpadlib.launchpad import Launchpad as LP |
666 | - pkg = 'python3-ubuntutools' |
667 | - from ubuntutools.archive import UbuntuSourcePackage, DebianSourcePackage, DownloadError |
668 | - import ubuntutools.lp.lpapicache |
669 | - from ubuntutools.lp.lpapicache import SourcePackagePublishingHistory |
670 | -except ImportError: |
671 | - logging.error('Is %s installed?', pkg) |
672 | - sys.exit(1) |
673 | +import cachetools |
674 | +from distro_info import DebianDistroInfo, UbuntuDistroInfo |
675 | +from launchpadlib.launchpad import Launchpad as LP |
676 | +from ubuntutools.archive import UbuntuSourcePackage, DebianSourcePackage, DownloadError |
677 | +import ubuntutools.lp.lpapicache |
678 | +from ubuntutools.lp.lpapicache import SourcePackagePublishingHistory |
679 | |
680 | _ddi = DebianDistroInfo() |
681 | _udi = UbuntuDistroInfo() |
682 | @@ -637,7 +629,7 @@ class GitUbuntuSourceInformation(object): |
683 | ) |
684 | ) |
685 | yield spi |
686 | - raise StopIteration() |
687 | + return |
688 | |
689 | @staticmethod |
690 | def interleave_launchpad_versions_published_after( |
691 | diff --git a/gitubuntu/submit.py b/gitubuntu/submit.py |
692 | index 19e7678..aba426f 100644 |
693 | --- a/gitubuntu/submit.py |
694 | +++ b/gitubuntu/submit.py |
695 | @@ -16,12 +16,7 @@ from gitubuntu.git_repository import ( |
696 | from gitubuntu.run import decode_binary, run |
697 | from gitubuntu.source_information import GitUbuntuSourceInformation, launchpad_login_auth |
698 | |
699 | -try: |
700 | - pkg = 'python3-lazr.restfulclient' |
701 | - from lazr.restfulclient.errors import BadRequest |
702 | -except ImportError: |
703 | - logging.error('Is %s installed?', pkg) |
704 | - sys.exit(1) |
705 | +from lazr.restfulclient.errors import BadRequest |
706 | |
707 | |
708 | def parse_args(subparsers=None, base_subparsers=None): |
709 | diff --git a/gitubuntu/test_fixtures.py b/gitubuntu/test_fixtures.py |
710 | index 60a5457..cef8b82 100644 |
711 | --- a/gitubuntu/test_fixtures.py |
712 | +++ b/gitubuntu/test_fixtures.py |
713 | @@ -23,6 +23,15 @@ def repo(): |
714 | except OSError: |
715 | oldcwd = None |
716 | |
717 | + # The git CLI requires a valid email address to be available. Normally, we |
718 | + # might expect this to be the git-ubuntu CLI caller's responsibility to |
719 | + # set. However, in tests, since GitUbuntuRepository calls the git CLI for |
720 | + # some operations that cannot currently be done through pygit2, it makes |
721 | + # sense to set EMAIL temporarily so that the test suite is independent of |
722 | + # the environment in which it is running. |
723 | + old_email = os.environ.get('EMAIL') |
724 | + os.environ['EMAIL'] = 'test@example.com' |
725 | + |
726 | with tempfile.TemporaryDirectory() as path: |
727 | os.chdir(path) |
728 | try: |
729 | @@ -33,6 +42,18 @@ def repo(): |
730 | if oldcwd: |
731 | os.chdir(oldcwd) |
732 | |
733 | + # Reset the EMAIL environment variable to what it was. This makes |
734 | + # little practical difference, but may prevent confusion and a |
735 | + # headache if in the future a different test is written that does |
736 | + # not use this fixture but does rely somehow on the EMAIL |
737 | + # environment variable not changing, as such a test would become |
738 | + # non-deterministic depending on whether other tests have run that |
739 | + # use this fixture. |
740 | + if old_email is None: |
741 | + del os.environ['EMAIL'] |
742 | + else: |
743 | + os.environ['EMAIL'] = old_email |
744 | + |
745 | |
746 | @pytest.fixture |
747 | def pygit2_repo(): |
748 | diff --git a/gitubuntu/versioning.py b/gitubuntu/versioning.py |
749 | index bf58426..2d12cd5 100644 |
750 | --- a/gitubuntu/versioning.py |
751 | +++ b/gitubuntu/versioning.py |
752 | @@ -9,17 +9,11 @@ from gitubuntu.source_information import ( |
753 | NoPublicationHistoryException, |
754 | ) |
755 | |
756 | -try: |
757 | - pkg = 'python3-debian' |
758 | - import debian |
759 | - # This effectively declares an interface for the type of Version |
760 | - # object we want to use in the git-ubuntu code |
761 | - from debian.debian_support import NativeVersion as Version |
762 | - pkg = 'python3-pytest' |
763 | - import pytest |
764 | -except ImportError: |
765 | - logging.error('Is %s installed?', pkg) |
766 | - sys.exit(1) |
767 | +import debian |
768 | +# This effectively declares an interface for the type of Version |
769 | +# object we want to use in the git-ubuntu code |
770 | +from debian.debian_support import NativeVersion as Version |
771 | +import pytest |
772 | |
773 | __all__ = [ |
774 | "next_development_version_string", |
775 | diff --git a/setup.py b/setup.py |
776 | index 8262eed..8d8d68b 100644 |
777 | --- a/setup.py |
778 | +++ b/setup.py |
779 | @@ -39,6 +39,7 @@ setup(name='gitubuntu', |
780 | 'pytest==3.1.3', |
781 | 'pytest-cov==2.5.1', |
782 | 'systemd-python', |
783 | + 'ubuntutools', |
784 | 'zmq', |
785 | ] |
786 | ) |
787 | diff --git a/snap-wrappers/wrappers/awk b/snap-wrappers/wrappers/awk |
788 | deleted file mode 100755 |
789 | index 2d4abb7..0000000 |
790 | --- a/snap-wrappers/wrappers/awk |
791 | +++ /dev/null |
792 | @@ -1,7 +0,0 @@ |
793 | -#!/snap/git-ubuntu/current/bin/bash |
794 | - |
795 | -CORE_SNAP="/snap/core/current" |
796 | -CORE_SNAP_PATH="$CORE_SNAP/usr/local/sbin:$CORE_SNAP/usr/local/bin:$CORE_SNAP/usr/sbin:$CORE_SNAP/usr/bin:$CORE_SNAP/sbin:$CORE_SNAP/bin" |
797 | -export PATH="$CORE_SNAP_PATH" |
798 | -export LD_LIBRARY_PATH="$CORE_SNAP/lib/x86_64-linux-gnu:$CORE_SNAP/usr/lib/x86_64-linux-gnu" |
799 | -exec "$CORE_SNAP/lib64/ld-linux-x86-64.so.2" "$CORE_SNAP/usr/bin/awk" "$@" |
800 | diff --git a/snap-wrappers/wrappers/gbp b/snap-wrappers/wrappers/gbp |
801 | index 77145d7..fef0928 100755 |
802 | --- a/snap-wrappers/wrappers/gbp |
803 | +++ b/snap-wrappers/wrappers/gbp |
804 | @@ -1,9 +1,3 @@ |
805 | #!/snap/git-ubuntu/current/bin/bash |
806 | |
807 | -CORE_SNAP="/snap/core/current" |
808 | -CORE_SNAP_PATH="$CORE_SNAP/usr/local/sbin:$CORE_SNAP/usr/local/bin:$CORE_SNAP/usr/sbin:$CORE_SNAP/usr/bin:$CORE_SNAP/sbin:$CORE_SNAP/bin" |
809 | -export PATH="$SNAP/bin/snap:$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
810 | -export PYTHONPATH="$SNAP/lib/python3.6/site-packages" |
811 | -export PERL5LIB="$SNAP/usr/share/perl5:$SNAP/usr/share/perl/5.22" |
812 | -export DPKG_DATADIR="$SNAP/usr/share/dpkg" |
813 | -exec "$SNAP/usr/bin/python3" "$SNAP/bin/gbp" "$@" |
814 | +exec "$SNAP/usr/bin/python3" "$SNAP/usr/bin/gbp" "$@" |
815 | diff --git a/snap-wrappers/wrappers/git-merge-changelogs b/snap-wrappers/wrappers/git-merge-changelogs |
816 | deleted file mode 100755 |
817 | index e78ce69..0000000 |
818 | --- a/snap-wrappers/wrappers/git-merge-changelogs |
819 | +++ /dev/null |
820 | @@ -1,24 +0,0 @@ |
821 | -#!/snap/git-ubuntu/current/bin/bash |
822 | - |
823 | -set -e |
824 | - |
825 | -branch_base="$1" |
826 | -branch_a="$2" |
827 | -branch_b="$3" |
828 | - |
829 | -if [ ! -d debian ]; then |
830 | - echo "$1: must be run from the top level of an unpacked Debian source package." >&2 |
831 | - exit 2 |
832 | -fi |
833 | - |
834 | -file_base=`mktemp git-mergechangelogs.XXXXXXXXXX` |
835 | -file_a=`mktemp git-mergechangelogs.XXXXXXXXXX` |
836 | -file_b=`mktemp git-mergechangelogs.XXXXXXXXXX` |
837 | -cleanup() { rm -f "$file_base" "$file_a" "$file_b"; } |
838 | -trap cleanup EXIT |
839 | - |
840 | -filename=changelog |
841 | -git show "${branch_base}:debian/$filename" > "$file_base" |
842 | -git show "${branch_a}:debian/$filename" > "$file_a" |
843 | -git show "${branch_b}:debian/$filename" > "$file_b" |
844 | -dpkg-mergechangelogs "$file_base" "$file_a" "$file_b" > debian/$filename |
845 | diff --git a/snap-wrappers/wrappers/git-reconstruct-changelog b/snap-wrappers/wrappers/git-reconstruct-changelog |
846 | deleted file mode 100755 |
847 | index 8fbb9f9..0000000 |
848 | --- a/snap-wrappers/wrappers/git-reconstruct-changelog |
849 | +++ /dev/null |
850 | @@ -1,18 +0,0 @@ |
851 | -#!/snap/git-ubuntu/current/bin/bash |
852 | - |
853 | -set -e |
854 | - |
855 | -tempfile=`mktemp --tmpdir git-reconstruct-changelog.XXXXXXXXXX` |
856 | -cleanup() { rm -f "$tempfile"; } |
857 | -trap cleanup EXIT |
858 | - |
859 | -dch PLACEHOLDER |
860 | -sed -n '1,/PLACEHOLDER/{/PLACEHOLDER/!p}' debian/changelog > "$tempfile" |
861 | -for rev in `git rev-list --reverse $1..HEAD`; do |
862 | - if [ "`git diff --name-only $rev^ $rev`" = debian/changelog ]; then |
863 | - continue |
864 | - fi |
865 | - git log --pretty=%B -n1 $rev|sed '/^$/d' >> "$tempfile" |
866 | -done |
867 | -sed -n '1,/PLACEHOLDER/!p' debian/changelog >> "$tempfile" |
868 | -mv "$tempfile" debian/changelog |
869 | diff --git a/snap-wrappers/wrappers/git-ubuntu-man b/snap-wrappers/wrappers/git-ubuntu |
870 | similarity index 50% |
871 | rename from snap-wrappers/wrappers/git-ubuntu-man |
872 | rename to snap-wrappers/wrappers/git-ubuntu |
873 | index 623cdd2..138ffb7 100755 |
874 | --- a/snap-wrappers/wrappers/git-ubuntu-man |
875 | +++ b/snap-wrappers/wrappers/git-ubuntu |
876 | @@ -1,3 +1,3 @@ |
877 | #!/snap/git-ubuntu/current/bin/bash |
878 | |
879 | -man -M $SNAP/usr/share/man $@ 2>/dev/null || man $@ |
880 | +exec "$SNAP/usr/bin/python3" "$SNAP/usr/bin/git-ubuntu" "$@" |
881 | diff --git a/snap-wrappers/wrappers/merge-changelogs b/snap-wrappers/wrappers/merge-changelogs |
882 | new file mode 100755 |
883 | index 0000000..97f0a2a |
884 | --- /dev/null |
885 | +++ b/snap-wrappers/wrappers/merge-changelogs |
886 | @@ -0,0 +1,3 @@ |
887 | +#!/snap/git-ubuntu/current/bin/bash |
888 | + |
889 | +exec "$SNAP/bin/bash" "$SNAP/usr/bin/git-ubuntu.merge-changelogs" |
890 | diff --git a/snap-wrappers/wrappers/quilt b/snap-wrappers/wrappers/quilt |
891 | index ed09371..49dea83 100755 |
892 | --- a/snap-wrappers/wrappers/quilt |
893 | +++ b/snap-wrappers/wrappers/quilt |
894 | @@ -1,8 +1,3 @@ |
895 | #!/snap/git-ubuntu/current/bin/bash |
896 | |
897 | -CORE_SNAP="/snap/core/current" |
898 | -CORE_SNAP_PATH="$CORE_SNAP/usr/local/sbin:$CORE_SNAP/usr/local/bin:$CORE_SNAP/usr/sbin:$CORE_SNAP/usr/bin:$CORE_SNAP/sbin:$CORE_SNAP/bin" |
899 | -export PATH="$SNAP/bin/snap:$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
900 | -export LD_LIBRARY_PATH="$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu" |
901 | -export QUILT_DIR="$SNAP/usr/share/quilt" |
902 | -exec "$SNAP/usr/bin/quilt" "$@" |
903 | +exec "$SNAP/bin/bash" "$SNAP/usr/bin/quilt" "$@" |
904 | diff --git a/snap-wrappers/wrappers/reconstruct-changelog b/snap-wrappers/wrappers/reconstruct-changelog |
905 | new file mode 100755 |
906 | index 0000000..4f72c77 |
907 | --- /dev/null |
908 | +++ b/snap-wrappers/wrappers/reconstruct-changelog |
909 | @@ -0,0 +1,3 @@ |
910 | +#!/snap/git-ubuntu/current/bin/bash |
911 | + |
912 | +exec "$SNAP/bin/bash" "$SNAP/usr/bin/git-ubuntu.reconstruct-changelog" |
913 | diff --git a/snap-wrappers/wrappers/self-test b/snap-wrappers/wrappers/self-test |
914 | new file mode 100755 |
915 | index 0000000..4e950e2 |
916 | --- /dev/null |
917 | +++ b/snap-wrappers/wrappers/self-test |
918 | @@ -0,0 +1,3 @@ |
919 | +#!/snap/git-ubuntu/current/bin/bash |
920 | + |
921 | +exec "$SNAP/bin/bash" "$SNAP/usr/share/git-ubuntu/self-test" |
922 | diff --git a/snap.sh b/snap.sh |
923 | new file mode 100644 |
924 | index 0000000..8d2bb89 |
925 | --- /dev/null |
926 | +++ b/snap.sh |
927 | @@ -0,0 +1,101 @@ |
928 | +#!/bin/sh |
929 | +set -e |
930 | + |
931 | +# This script is a workaround for LP: #1918968. A deb is built, added to an apt |
932 | +# repository, snapcraft.yaml adjusted to add a new "package-repositories" |
933 | +# section pointing to it, and then snapcraft is run to generate the snap based |
934 | +# on it. |
935 | + |
936 | +# NOTE: THIS SCRIPT IS "DESTRUCTIVE" TO THE HOST |
937 | +# |
938 | +# It will install deb and snap dependencies using "sudo" on your system as well |
939 | +# as install a temporariy git-ubuntu deb locally as built from this source tree |
940 | +# and add sources and keys to apt for this purpose. It is intended for use in a |
941 | +# temporary VM environment only. |
942 | + |
943 | +tmp_dir=$(mktemp -d) |
944 | +cleanup() { rm -rf "$tmp_dir"; } |
945 | +trap cleanup EXIT |
946 | + |
947 | +# Install dependencies of this script |
948 | +# apt-utils: needed for apt-ftparchive |
949 | +# devscripts: needed for mk-build-deps and dch |
950 | +# equivs: needed by mk-build-deps |
951 | +# python3 and python3-yaml: needed to modify snapcraft.yaml |
952 | +sudo apt-get update |
953 | +sudo apt-get install -y --no-install-recommends \ |
954 | + apt-utils \ |
955 | + devscripts \ |
956 | + equivs \ |
957 | + python3 \ |
958 | + python3-yaml |
959 | +sudo snap install --classic snapcraft |
960 | + |
961 | +# Set up debian/changelog with an appropriate version string |
962 | +snap_version=$(git describe) |
963 | +# Replace the hyphens appropriately to construct a valid Debian native version |
964 | +# string |
965 | +deb_version=$(echo $snap_version|sed 's/-/+/;s/-/./g') |
966 | + |
967 | +export DEBEMAIL=ubuntu-devel-discuss@lists.ubuntu.com |
968 | +export DEBFULLNAME="git-ubuntu snap.sh build script" |
969 | +dch -v "$deb_version" '' |
970 | +dch -r -D focal '' |
971 | + |
972 | +# Install deb build dependencies and build the deb |
973 | +mk-build-deps |
974 | +# --allow-downgrades is helpful for development of this script because it |
975 | +# ensures that the build dependency package gets updated regardless of the |
976 | +# previous version used. In production it is a no-op. |
977 | +sudo apt-get install -y --allow-downgrades ./git-ubuntu-build-deps_${deb_version}_all.deb |
978 | +debian/rules build |
979 | +fakeroot debian/rules binary |
980 | + |
981 | +# Workaround for LP: #1918969: temporary apt repository signing |
982 | +export GNUPGHOME="$tmp_dir/gpg" |
983 | +mkdir -m700 "$GNUPGHOME" |
984 | +gpg --batch --gen-key <<EOF |
985 | +%no-protection |
986 | +Key-Type:1 |
987 | +Key-Length:2048 |
988 | +Subkey-Type:1 |
989 | +Subkey-Length:2048 |
990 | +Name-Real: git-ubuntu build script apt repo |
991 | +Name-Email: ubuntu-devel-discuss@lists.ubuntu.com |
992 | +Expire-Date:0 |
993 | +EOF |
994 | +key_id=$(gpg --list-keys --batch --with-colons|awk -F: '$1=="fpr"{print $10;exit}') |
995 | +mkdir -p snap/keys |
996 | +# 'expr substr "$key_id" 1 8' is a workaround for LP: #1918967 |
997 | +gpg --batch -a -o snap/keys/$(expr substr "$key_id" 1 8).asc --export |
998 | + |
999 | +build_dir=$(pwd) |
1000 | +repo_dir="$tmp_dir/repo" |
1001 | +mkdir "$repo_dir" |
1002 | +cd "$repo_dir" |
1003 | +mv "$build_dir/../git-ubuntu_${deb_version}_all.deb" . |
1004 | +apt-ftparchive packages . | tee Packages | gzip > Packages.gz |
1005 | +apt-ftparchive release . > Release |
1006 | +gpg --yes -o Release.gpg -ab Release |
1007 | +cd "$build_dir" |
1008 | + |
1009 | +# Update snapcraft.yaml with a pointer to our temporary apt repository |
1010 | +python3 <<EOT |
1011 | +import yaml |
1012 | +with open('snap/snapcraft.yaml') as f: |
1013 | + snapcraft = yaml.safe_load(f) |
1014 | +# The version is tweaked here to avoid the snap version being marked "dirty" |
1015 | +# just because we are modifying snapcraft.yaml with this script. |
1016 | +snapcraft['version'] = '$snap_version' |
1017 | +snapcraft['package-repositories'] = [{ |
1018 | + 'type': 'apt', |
1019 | + 'url': 'file://' + '$repo_dir', |
1020 | + 'path': '.', |
1021 | + 'key-id': '$key_id', |
1022 | +}] |
1023 | +with open('snap/snapcraft.yaml', 'w') as f: |
1024 | + yaml.dump(snapcraft, f) |
1025 | +EOT |
1026 | + |
1027 | +# Build the snap itself |
1028 | +snapcraft --destructive-mode --enable-experimental-package-repositories |
1029 | diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml |
1030 | index 3edcd63..bb00454 100644 |
1031 | --- a/snap/snapcraft.yaml |
1032 | +++ b/snap/snapcraft.yaml |
1033 | @@ -3,456 +3,86 @@ version: git |
1034 | summary: Ubuntu development git tooling |
1035 | description: Maintain an Ubuntu source package in a git tree |
1036 | confinement: classic |
1037 | -grade: stable |
1038 | +grade: devel |
1039 | +base: core20 |
1040 | |
1041 | environment: |
1042 | - CORE_SNAP: "/snap/core/current" |
1043 | - CORE_SNAP_PATH: "$CORE_SNAP/usr/local/sbin:$CORE_SNAP/usr/local/bin:$CORE_SNAP/usr/sbin:$CORE_SNAP/usr/bin:$CORE_SNAP/sbin:$CORE_SNAP/bin" |
1044 | - PERL5LIB: "$SNAP/usr/share/perl5:$SNAP/usr/share/perl/5.22" |
1045 | - DPKG_DATADIR: "$SNAP/usr/share/dpkg" |
1046 | - GIT_EXEC_PATH: "$SNAP/libexec/git-core" |
1047 | - GIT_TEMPLATE_DIR: "$SNAP/share/git-core/templates" |
1048 | + DPKG_DATADIR: "$SNAP/usr/share/dpkg" |
1049 | + QUILT_DIR: "$SNAP/usr/share/quilt" |
1050 | + GIT_EXEC_PATH: "$SNAP/usr/lib/git-core" |
1051 | + GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates" |
1052 | + PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin" |
1053 | + PERL5LIB: "$SNAP/usr/share/perl5:$SNAP/usr/share/perl/5.30" |
1054 | + PYTHONPATH: "$SNAP/usr/lib/python3/dist-packages" |
1055 | |
1056 | apps: |
1057 | - git-ubuntu: |
1058 | - command: bin/git-ubuntu |
1059 | - environment: |
1060 | - ORIG_PATH: "$PATH" |
1061 | - PYTHONPATH: "$SNAP/lib/python3.6/site-packages" |
1062 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1063 | - man: |
1064 | - command: wrappers/git-ubuntu-man |
1065 | - environment: |
1066 | - LD_LIBRARY_PATH: "$SNAP/usr/lib/man-db:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu" |
1067 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1068 | - reconstruct-changelog: |
1069 | - command: wrappers/git-reconstruct-changelog |
1070 | - environment: |
1071 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1072 | - merge-changelogs: |
1073 | - command: wrappers/git-merge-changelogs |
1074 | - environment: |
1075 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1076 | - self-test: |
1077 | - command: wrappers/git-ubuntu-self-test |
1078 | - environment: |
1079 | - PYTHONPATH: "$SNAP/lib/python3.6/site-packages" |
1080 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1081 | - import-source-packages: |
1082 | - command: bin/import-source-packages.py |
1083 | - environment: |
1084 | - ORIG_PATH: "$PATH" |
1085 | - PYTHONPATH: "$SNAP/lib/python3.6/site-packages" |
1086 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1087 | - source-package-walker: |
1088 | - command: bin/source-package-walker.py |
1089 | - environment: |
1090 | - PYTHONPATH: "$SNAP/lib/python3.6/site-packages" |
1091 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1092 | - update-repository-alias: |
1093 | - command: bin/update-repository-alias.py |
1094 | - environment: |
1095 | - PYTHONPATH: "$SNAP/lib/python3.6/site-packages" |
1096 | - PATH: "$SNAP/usr/local/sbin:$SNAP/usr/local/bin:$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CORE_SNAP_PATH" |
1097 | + git-ubuntu: |
1098 | + command: wrappers/git-ubuntu |
1099 | + self-test: |
1100 | + command: wrappers/self-test |
1101 | + reconstruct-changelog: |
1102 | + command: wrappers/reconstruct-changelog |
1103 | + merge-changeloges: |
1104 | + command: wrappers/merge-changelogs |
1105 | |
1106 | -parts: |
1107 | - gbp: |
1108 | - plugin: python |
1109 | - python-version: python3 |
1110 | - # from https://github.com/agx/git-buildpackage/archive/debian/0.9.6.tar.gz |
1111 | - source: https://people.canonical.com/~rbasak/git-ubuntu/github-gbp-debian-0.9.6.tar.gz |
1112 | - source-type: tar |
1113 | - source-checksum: sha384/5c9be5a0cdcd0c2a89de2470617361d5f891befa854f32a40e96b2443668fef2068456bf6bcb5ac11c92a0487531a782 |
1114 | - requirements: requirements.txt |
1115 | - stage: |
1116 | - - -usr/bin/py* |
1117 | - - -usr/bin/2to3* |
1118 | - - -usr/share/*python* |
1119 | - - -usr/lib/python3.5 |
1120 | - - -usr/lib/python3.6 |
1121 | - after: [git, pristine-tar, python3] |
1122 | - git: |
1123 | - plugin: autotools |
1124 | - # from https://github.com/git/git/archive/v2.14.3.tar.gz |
1125 | - source: https://people.canonical.com/~rbasak/git-ubuntu/github-git-v2.14.3.tar.gz |
1126 | - source-type: tar |
1127 | - source-checksum: sha384/0d28faa4cc66b81ab262f44433b24261cbd39851648723d6701dd5463ab8fb6989b18d46523a4e238a697a1ef78db938 |
1128 | - build-packages: |
1129 | - - libz-dev |
1130 | - - gettext |
1131 | - - libpcre3-dev |
1132 | - - libcurl4-gnutls-dev |
1133 | - - libexpat1-dev |
1134 | - - libyaml-perl |
1135 | - - tcl |
1136 | - - libhttp-date-perl |
1137 | - - libcgi-pm-perl |
1138 | - - libdbd-sqlite3-perl |
1139 | - - unzip |
1140 | - - libio-pty-perl |
1141 | - dpkg: |
1142 | - plugin: autotools |
1143 | - # generated with, in a Bionic container: |
1144 | - # sudo apt update && sudo apt -y install autoconf autopoint pkg-config libtool libncursesw5-dev gettext po4a |
1145 | - # git clone https://anonscm.debian.org/git/dpkg/dpkg.git -b 1.18.24 |
1146 | - # cd dpkg |
1147 | - # autoreconf -f -i |
1148 | - # ./configure |
1149 | - # make dist |
1150 | - source: https://people.canonical.com/~rbasak/git-ubuntu/dpkg-1.18.24.tar.xz |
1151 | - source-type: tar |
1152 | - source-checksum: sha384/54539fcf0f303ac4a2cff70f3f8fcf01325d2f84e757de02812d54d7603475c750b72380fab41b135930d5726c7dc541 |
1153 | - configflags: |
1154 | - - --prefix=/usr |
1155 | - - --sysconfdir=/etc |
1156 | - - --sbindir=/sbinn |
1157 | - - --localstatedir=/var |
1158 | - - --libexecdir=${exec_prefix/lib} |
1159 | - build-packages: |
1160 | - - pkg-config |
1161 | - - libncursesw5-dev |
1162 | - xz-utils: |
1163 | - plugin: autotools |
1164 | - # from https://github.com/xz-mirror/xz/releases/download/v5.2.2/xz-5.2.2.tar.xz |
1165 | - source: https://people.canonical.com/~rbasak/git-ubuntu/xz-5.2.2.tar.xz |
1166 | - source-type: tar |
1167 | - source-checksum: sha384/ccb584d0325497eb4c7dbba930c0fff388efe2cbc3636507ba654084948965cc18325ca4835f972c8083db4e381fbbdc |
1168 | - configflags: [--prefix=/usr] |
1169 | - after: [dpkg] |
1170 | - tar: |
1171 | - plugin: x-tar |
1172 | - # from https://ftp.gnu.org/gnu/tar/tar-1.29.tar.xz |
1173 | - source: https://people.canonical.com/~rbasak/git-ubuntu/tar-1.29.tar.xz |
1174 | - source-type: tar |
1175 | - source-checksum: sha384/b7d517a81a74c649893cb56958a06edabca7e6c67df9ec5c9c67b974216a4ef2e0eb427dc6d1e1a80c91c89e0b6ac751 |
1176 | - after: [xz-utils] |
1177 | - xdelta: |
1178 | - plugin: autotools |
1179 | - # generated with |
1180 | - # git clone https://anonscm.debian.org/git/users/lamont/xdelta.git -b v1.1.3-9 |
1181 | - # cd xdelta |
1182 | - # git archive --prefix xdelta-$(git describe)/ -o ../xdelta-$(git describe).tar.gz HEAD |
1183 | - source: https://people.canonical.com/~rbasak/git-ubuntu/xdelta-v1.1.3-9.tar.gz |
1184 | - source-type: tar |
1185 | - source-checksum: sha384/441b051fb9a4941ffb49efb0e82184227c9a9299cdd63d5d814f27f0017bceb2ef624615448268d34edaf696604fe62e |
1186 | - build-packages: |
1187 | - - libtool-bin |
1188 | - - libglib2.0-dev |
1189 | - - zlib1g-dev |
1190 | - xdelta3: |
1191 | - plugin: autotools |
1192 | - # from https://github.com/jmacd/xdelta/archive/v3.0.11.tar.gz |
1193 | - source: https://people.canonical.com/~rbasak/git-ubuntu/github-jmacd-xdelta-v3.0.11.tar.gz |
1194 | - source-type: tar |
1195 | - source-checksum: sha384/c1c0b70aa064b5bd02857d3547720fb3581752882e1ebb7391afb8e270e10b654a8b7bcf114ac1073c2787c9a115c03b |
1196 | - build: | |
1197 | - cd xdelta3 |
1198 | - ./run_release.sh || true |
1199 | - ./run_release.sh || true |
1200 | - autoreconf |
1201 | - ./configure --prefix=$SNAPCRAFT_PART_INSTALL/usr |
1202 | - make |
1203 | - install: | |
1204 | - cd xdelta3 |
1205 | - make install |
1206 | - after: [xz-utils] |
1207 | - pristine-tar: |
1208 | - plugin: make |
1209 | - # generated with |
1210 | - # git clone https://anonscm.debian.org/cgit/collab-maint/pristine-tar.git -b 1.41 |
1211 | - # cd pristine-tar |
1212 | - # # git describe can't be used due to upstream tag issue |
1213 | - # git archive --prefix pristine-tar-1.41/ -o ../pristine-tar-1.41.tar.gz HEAD |
1214 | - source: https://people.canonical.com/~rbasak/git-ubuntu/pristine-tar-1.41.tar.gz |
1215 | - source-type: tar |
1216 | - source-checksum: sha384/0c202500d368051711bd7e827a29a6d93f9eba37ddee4950e1b24d510d9347635111b4e7dc716bd837a7f5c4d40e6238 |
1217 | - prepare: | |
1218 | - perl Makefile.PL PREFIX=/usr |
1219 | - after: [git, tar, xdelta3] |
1220 | - launchpadlib: |
1221 | - plugin: python |
1222 | - python-version: python3 |
1223 | - # from https://launchpad.net/ubuntu/+source/python-launchpadlib/1.10.6-1 |
1224 | - source: https://launchpad.net/ubuntu/+archive/primary/+files/python-launchpadlib_1.10.6.orig.tar.gz |
1225 | - source-type: tar |
1226 | - source-checksum: sha384/fd87f3f02e86179e8bc8e07f52ca8aad59db93c7dd53057198b77fe4591593cda4a29d935b6e8a8386f6f6ddb83d4762 |
1227 | - build-packages: |
1228 | - - libffi-dev |
1229 | - stage: |
1230 | - - -usr/bin/py* |
1231 | - - -usr/bin/2to3* |
1232 | - - -usr/share/*python* |
1233 | - - -usr/lib/python3.5 |
1234 | - - -usr/lib/python3.6 |
1235 | - - -lib/python3.6/site-packages/keyring |
1236 | - after: [python3] |
1237 | - python2: |
1238 | - # from http://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz |
1239 | - source: https://people.canonical.com/~rbasak/git-ubuntu/Python-2.7.14.tar.xz |
1240 | - source-type: tar |
1241 | - source-checksum: sha384/b5f8304a9f3f368625798cb6c9ba0d1fa4b3142f83f5039d8de59e9f70a36c4250a734f27ec27c16268dc8f9502c007e |
1242 | - plugin: autotools |
1243 | - configflags: [--prefix=/usr] |
1244 | - build-packages: |
1245 | - - libssl-dev |
1246 | - - libsqlite3-dev |
1247 | - stage: |
1248 | - - -usr/bin/2to3* |
1249 | - - -usr/lib/python2.7/test |
1250 | - # need it at runtime, but want to build it using the stage |
1251 | - # packages |
1252 | - after: [ubuntutools-python2] |
1253 | - python3: |
1254 | - # from http://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz |
1255 | - source: https://people.canonical.com/~rbasak/git-ubuntu/Python-3.6.3.tar.xz |
1256 | - source-type: tar |
1257 | - source-checksum: sha384/72597cc86c893031af194404c97c5e15114cfb75833fab0dc53b4bc08f5928b094d5b4d405edc9543087970944790f70 |
1258 | - plugin: autotools |
1259 | - configflags: [--prefix=/usr] |
1260 | - build-packages: |
1261 | - - libssl-dev |
1262 | - - libsqlite3-dev |
1263 | - - libbz2-dev |
1264 | - - liblzma-dev |
1265 | - - libdb-dev |
1266 | - - libgdbm-dev |
1267 | - - libreadline-dev |
1268 | - stage: |
1269 | - - -usr/lib/python3.6/test |
1270 | - ubuntutools-python2: |
1271 | - plugin: python |
1272 | - python-version: python2 |
1273 | - # generated with |
1274 | - # git clone https://git.launchpad.net/ubuntu-dev-tools -b 0.161 |
1275 | - # cd ubuntu-dev-tools |
1276 | - # git archive --prefix ubuntu-dev-tools-$(git describe)/ -o ../ubuntu-dev-tools-$(git describe).tar.gz HEAD |
1277 | - source: https://people.canonical.com/~rbasak/git-ubuntu/ubuntu-dev-tools-0.161.tar.gz |
1278 | - source-checksum: sha384/98fe630d6f644155b49b15c57b5d4f9f47bd918cc074359f5b5ac3fa283506b8fc2d557127f1b47dd2bd66e681c17104 |
1279 | - stage: |
1280 | - - -bin/* |
1281 | - - -usr/bin/* |
1282 | - - -share/man/* |
1283 | - - -share/ubuntu-dev-tools/enforced-editing-wrapper |
1284 | - - -usr/share/*python* |
1285 | - - -lib/python2.7/site-packages/oauth* |
1286 | - - -usr/lib/python2.7 |
1287 | - ubuntutools-python3: |
1288 | - plugin: python |
1289 | - python-version: python3 |
1290 | - # generated with |
1291 | - # git clone https://git.launchpad.net/ubuntu-dev-tools -b 0.176 |
1292 | - # cd ubuntu-dev-tools |
1293 | - # git archive --prefix ubuntu-dev-tools-$(git describe)/ -o ../ubuntu-dev-tools-$(git describe).tar.gz HEAD |
1294 | - source: https://people.canonical.com/~rbasak/git-ubuntu/ubuntu-dev-tools-0.176.tar.gz |
1295 | - source-checksum: sha384/24c255fcebe48ad6bdc6aa4cf197753b4c1683bb70458c2170593f70e8820911d61632cd99ec48f540eadad3ba5a9f56 |
1296 | - stage: |
1297 | - - -usr/bin/py* |
1298 | - - -usr/bin/2to3* |
1299 | - - -usr/share/*python* |
1300 | - - -lib/python3.5/site-packages/oauth* |
1301 | - - -lib/python3.6/site-packages/oauth* |
1302 | - - -usr/lib/python3.5 |
1303 | - - -usr/lib/python3.6 |
1304 | - after: [python3] |
1305 | - distro-info: |
1306 | - plugin: python |
1307 | - python-version: python3 |
1308 | - # generated with |
1309 | - # git clone https://anonscm.debian.org/git/collab-maint/distro-info.git -b debian/0.17 |
1310 | - # cd distro-info |
1311 | - # #can't use git describe because of the upstream tag names |
1312 | - # git archive --prefix distro-info-0.17/ -o ../distro-info-0.17.tar.gz HEAD |
1313 | - source: https://people.canonical.com/~rbasak/git-ubuntu/distro-info-0.17.tar.gz |
1314 | - source-checksum: sha384/2192b97c15a5c1669ac8acdcaa37766a3898b440b14156422bef322dc4f42b2159f2ec87e49e818801bde0f0c359cb38 |
1315 | - source-subdir: python |
1316 | - stage: |
1317 | - - -usr/bin/py* |
1318 | - - -usr/bin/2to3* |
1319 | - - -usr/share/*python* |
1320 | - - -usr/lib/python3.5 |
1321 | - - -usr/lib/python3.6 |
1322 | - stage-packages: |
1323 | - - distro-info |
1324 | - after: [python3] |
1325 | - libgpg-error: |
1326 | - plugin: autotools |
1327 | - # from https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2 |
1328 | - source: https://people.canonical.com/~rbasak/git-ubuntu/libgpg-error-1.27.tar.bz2 |
1329 | - source-type: tar |
1330 | - source-checksum: sha384/cf2e9e7ce6b5ed993b3f8f1d45f1d72b07a30544533142c48f1515d9fc1638fe976c639febca0b838489f6c34dc2f36d |
1331 | - configflags: [--prefix=/usr] |
1332 | - stage: |
1333 | - - -usr/share/info |
1334 | - libgcrypt: |
1335 | - plugin: autotools |
1336 | - # from https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.1.tar.bz2 |
1337 | - source: https://people.canonical.com/~rbasak/git-ubuntu/libgcrypt-1.8.1.tar.bz2 |
1338 | - source-type: tar |
1339 | - source-checksum: sha384/823b1e4a0c8d5dad5aabe0b192a92734ed95ccb3ba468483b3b6cd2765157458b620db0b020739d15397ddad81a93a3e |
1340 | - configflags: [--prefix=/usr] |
1341 | - stage: |
1342 | - - -usr/share/info |
1343 | - libassuan: |
1344 | - plugin: autotools |
1345 | - # from https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.1.tar.bz2 |
1346 | - source: https://people.canonical.com/~rbasak/git-ubuntu/libassuan-2.5.1.tar.bz2 |
1347 | - source-type: tar |
1348 | - source-checksum: sha384/e9bf675bd385e5bbe3fa8edf5632715b2fad67877c185ed12777caa6e985b2b967ccd836132ac3d28a10319057874d3d |
1349 | - configflags: [--prefix=/usr] |
1350 | - after: [libgpg-error] |
1351 | - stage: |
1352 | - - -usr/share/info |
1353 | - libksba: |
1354 | - plugin: autotools |
1355 | - # from https://gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2 |
1356 | - source: https://people.canonical.com/~rbasak/git-ubuntu/libksba-1.3.5.tar.bz2 |
1357 | - source-type: tar |
1358 | - source-checksum: sha384/7264394452d4ee0da9014949abd5b163d928a1c1216b7008653e04d6090d3cfad2a0a978e7159cee599a319cc5d7f574 |
1359 | - configflags: [--prefix=/usr] |
1360 | - stage: |
1361 | - - -usr/share/info |
1362 | - npth: |
1363 | - plugin: autotools |
1364 | - # from https://gnupg.org/ftp/gcrypt/npth/npth-1.5.tar.bz2 |
1365 | - source: https://people.canonical.com/~rbasak/git-ubuntu/npth-1.5.tar.bz2 |
1366 | - source-type: tar |
1367 | - source-checksum: sha384/48533ecf32da9b02a0f627c074479c211b75ee2bc005aa75157ea9e119e6ede38fe7dadfc0f64eb5b937edfec033a8bc |
1368 | - configflags: [--prefix=/usr] |
1369 | - stage: |
1370 | - - -usr/share/info |
1371 | - gnupg2: |
1372 | - plugin: autotools |
1373 | - # from https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.4.tar.bz2 |
1374 | - source: https://people.canonical.com/~rbasak/git-ubuntu/gnupg-2.2.4.tar.bz2 |
1375 | - source-type: tar |
1376 | - source-checksum: sha384/94926c62260c2a9552015ca155935a61578b1f3b06d3dbf080414007b95ceb2008bf0f86f69e0ea22996d27974befd9c |
1377 | - configflags: |
1378 | - - --prefix=/usr |
1379 | - - --enable-gpg2-is-gpg |
1380 | - after: |
1381 | - - libgpg-error |
1382 | - - libgcrypt |
1383 | - - libassuan |
1384 | - - libksba |
1385 | - - npth |
1386 | - stage: |
1387 | - - -usr/share/info |
1388 | - devscripts: |
1389 | - plugin: nil |
1390 | - stage-packages: |
1391 | - - devscripts |
1392 | - stage: |
1393 | - - -usr/share/perl5/Dpkg* |
1394 | - - -usr/bin/dpkg* |
1395 | - - -usr/share/dpkg |
1396 | - - -usr/bin/py* |
1397 | - - -usr/bin/2to3* |
1398 | - - -usr/share/*python* |
1399 | - - -usr/lib/python3.5 |
1400 | - - -usr/lib/python3.6 |
1401 | - - -usr/bin/lzmainfo |
1402 | - - -usr/bin/xz |
1403 | - - -usr/bin/xzdiff |
1404 | - - -usr/bin/xzgrep |
1405 | - - -usr/bin/xzless |
1406 | - - -usr/bin/xzmore |
1407 | - after: [gnupg2] |
1408 | - git-ubuntu: |
1409 | - plugin: python |
1410 | - python-version: python3 |
1411 | - source: . |
1412 | - build-packages: |
1413 | - - libsystemd-dev |
1414 | - stage-packages: |
1415 | - - bash |
1416 | - - fakeroot |
1417 | - - libffi-dev |
1418 | - - libssl-dev |
1419 | - - libgit2-dev |
1420 | - - libssh2-1-dev |
1421 | - - libzmq3-dev |
1422 | - - sendmail-bin |
1423 | - - quilt |
1424 | - - man-db |
1425 | - - pbzip2 |
1426 | - - bzip2 |
1427 | - - python3-systemd |
1428 | - stage: |
1429 | - - -usr/bin/py* |
1430 | - - -usr/bin/2to3* |
1431 | - - -usr/share/*python* |
1432 | - - -lib/python3.6/site-packages/oauth* |
1433 | - - -lib/python3.6/site-packages/launchpadlib* |
1434 | - - -lib/python3.6/site-packages/lazr/restfulclient* |
1435 | - - -usr/lib/python3.6 |
1436 | - - -usr/bin/gpg-error* |
1437 | - - -usr/share/aclocal/gpg-error.m4 |
1438 | - - -usr/lib/*/*gpg-error* |
1439 | - - -lib/*/*gpg-error* |
1440 | - - -usr/bin/dumpsexp |
1441 | - - -usr/bin/hmac256 |
1442 | - - -usr/bin/libgcrypt-config |
1443 | - - -usr/lib/*/*libgcrypt* |
1444 | - - -lib/*/*libcrypt* |
1445 | - - -usr/bin/mpicalc |
1446 | - - -usr/include/gcrypt.h |
1447 | - - -usr/share/aclocal/libgcrypt.m4 |
1448 | - - -lib/python3.6/site-packages/cryptography/hazmat/bindings/_constant_time.abi3.so |
1449 | - - -lib/python3.6/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so |
1450 | - - -lib/python3.6/site-packages/cryptography/hazmat/bindings/_padding.abi3.so |
1451 | - prime: |
1452 | - - -usr/share/doc |
1453 | - install: | |
1454 | - # Make $SNAP/etc/pylintrc available to git-ubuntu.self-test |
1455 | - cp ../../../.pylintrc $SNAPCRAFT_PART_INSTALL/etc/pylintrc |
1456 | +# package-repositories is inserted here by snap.sh |
1457 | +# See LP: #1918968 and snap.sh |
1458 | |
1459 | - cp $SNAPCRAFT_PART_INSTALL/usr/bin/fakeroot-sysv $SNAPCRAFT_PART_INSTALL/usr/bin/fakeroot |
1460 | - after: |
1461 | - - gbp |
1462 | - - pristine-tar |
1463 | - - distro-info |
1464 | - - ubuntutools-python2 |
1465 | - - ubuntutools-python3 |
1466 | - - python3 |
1467 | - - devscripts |
1468 | - - launchpadlib |
1469 | - wrappers: |
1470 | - source: snap-wrappers/ |
1471 | - plugin: dump |
1472 | - organize: |
1473 | - wrappers/gbp: usr/local/bin/gbp |
1474 | - wrappers/quilt: usr/local/bin/quilt |
1475 | - wrappers/awk: usr/local/bin/awk |
1476 | - wrappers/ssh: usr/local/bin/ssh |
1477 | - manpages: |
1478 | - source: man/ |
1479 | - plugin: dump |
1480 | - organize: |
1481 | - man1: usr/share/man/man1 |
1482 | - completion: |
1483 | - source: doc/ |
1484 | - plugin: dump |
1485 | - organize: |
1486 | - gitubuntu-completion.sh: etc/bash_completion.d/git-ubuntu |
1487 | - scripts: |
1488 | - source: bin/ |
1489 | - plugin: dump |
1490 | - organize: |
1491 | - git-reconstruct-changelog: bin/git-reconstruct-changelog |
1492 | - git-merge-changelogs: bin/git-merge-changelogs |
1493 | - import-source-packages.py: bin/import-source-packages.py |
1494 | - source-package-walker.py: bin/source-package-walker.py |
1495 | - update-repository-alias.py: bin/update-repository-alias.py |
1496 | - # Short-term workaround for the archive keyrings in older releases |
1497 | - # not being updated. Once the keyring packages are SRU'd, this can be |
1498 | - # dropped. LP: #1752656 |
1499 | - debian-archive-keyring: |
1500 | - plugin: dump |
1501 | - source: https://launchpad.net/ubuntu/+source/debian-archive-keyring/2019.1ubuntu2/+build/17235516/+files/debian-archive-keyring_2019.1ubuntu2_all.deb |
1502 | - source-type: deb |
1503 | - source-checksum: sha384/907e9ef7db90fdc456906ef4ac52f9e92b36f9528c8c1968ab63a5f0e87ea6bdfbebda66df84ca5265c56a55c68cd78c |
1504 | - ubuntu-keyring: |
1505 | - plugin: dump |
1506 | - source: https://launchpad.net/ubuntu/+source/ubuntu-keyring/2018.09.18.1/+build/15467225/+files/ubuntu-keyring_2018.09.18.1_all.deb |
1507 | - source-type: deb |
1508 | - source-checksum: sha384/7dc92ccfeb9bb7fc8e0dfa80b96f9706438fd148683f6df092ba6f1a926aceb0e2aeb0e019625683d84022ba1413e5a4 |
1509 | +parts: |
1510 | + git-ubuntu: |
1511 | + plugin: nil |
1512 | + override-prime: | |
1513 | + snapcraftctl prime |
1514 | + ln -s mawk usr/bin/awk |
1515 | + stage: |
1516 | + # Remove etc/rmt due to: |
1517 | + # The store was unable to accept this snap. |
1518 | + # - package contains external symlinks: etc/rmt |
1519 | + - -etc/rmt |
1520 | + stage-packages: |
1521 | + - git-ubuntu |
1522 | + - debian-keyring |
1523 | + - git |
1524 | + - git-buildpackage |
1525 | + - pristine-tar |
1526 | + - pylint |
1527 | + - quilt |
1528 | + - ubuntu-keyring |
1529 | + - libpython3-stdlib |
1530 | + - libpython3.8-stdlib |
1531 | + - libpython3.8-minimal |
1532 | + - python3-pip |
1533 | + - python3-setuptools |
1534 | + - python3-wheel |
1535 | + - python3-venv |
1536 | + - python3-minimal |
1537 | + - python3-distutils |
1538 | + - python3-pkg-resources |
1539 | + - python3.8-minimal |
1540 | + - python3-six |
1541 | + - python3-chardet |
1542 | + - python3-oauthlib |
1543 | + - python3-cffi-backend |
1544 | + - python3-attr |
1545 | + - python3-more-itertools |
1546 | + - python3-testresources |
1547 | + - grep |
1548 | + - coreutils |
1549 | + - gzip |
1550 | + - tar |
1551 | + - sed |
1552 | + - bash |
1553 | + - util-linux |
1554 | + - awk |
1555 | + - mawk |
1556 | + - findutils |
1557 | + - dpkg |
1558 | + - dpkg-dev |
1559 | + - gpgv |
1560 | + wrappers: |
1561 | + source: snap-wrappers/ |
1562 | + plugin: dump |
1563 | + organize: |
1564 | + wrappers/ssh: usr/local/bin/ssh |
1565 | + wrappers/gbp: usr/local/bin/gbp |
1566 | + wrappers/quilt: usr/local/bin/quilt |
Corresponding CI changes:
https:/ /github. com/canonical/ server- test-scripts/ pull/94 /github. com/canonical/ server- jenkins- jobs/pull/ 177
https:/