Compare commits

...

1046 Commits
0.134 ... main

Author SHA1 Message Date
Simon Quigley
466e2784de Upload to Unstable 2025-03-04 13:43:32 -06:00
Simon Quigley
ba3f0511f9 syncpackage: Catch exceptions cleanly, simply skipping to the next package (erring on the side of caution) if there is an error doing the download (LP: #1943286). 2025-03-04 13:42:50 -06:00
Simon Quigley
2e550ceff2 syncpackage: Cache the sync blocklist in-memory, so it's not fetched multiple times when syncing more than one package. 2025-03-04 13:39:07 -06:00
Simon Quigley
6c8a5d74bd syncpackage: s/syncblacklist/syncblocklist/g 2025-03-04 13:29:02 -06:00
Simon Quigley
3d11516599 mk-sbuild: default to using UTC for schroots (LP: #2097159). 2025-03-04 13:22:40 -06:00
Simon Quigley
5a20308ab1 Read ~/.devscripts in a more robust way, to ideally pick up multi-line variables (Closes: #725418). 2025-03-04 13:17:30 -06:00
Simon Quigley
b551877651 Add a changelog entry 2025-03-04 13:10:04 -06:00
ferbraher
4a4c4e0a27 Parsing arch parameter to getBinaryPackage() 2025-03-04 13:08:59 -06:00
Simon Quigley
865c1c97bc Add a changelog entry 2025-03-04 13:07:42 -06:00
Shengjing Zhu
d09718e976 import-bug-from-debian: package option is overridden and not used 2025-03-04 13:07:11 -06:00
Simon Quigley
bff7baecc9 Add a changelog entry 2025-03-04 13:06:38 -06:00
Dan Bungert
45fbbb5bd1 mk-sbuild: enable pkgmaintainermangler
mk-sbuild installs pkgbinarymangler into the schroot.  Of of the
provided tools in pkgbinarymangler is pkgmaintainermangler.
pkgmaintainermangler is disabled by default, and enabled with
configuration.

A difference between launchpad builds of a synced package and an sbuild
is that the maintainer information will be different.

Enable pkgmaintainermangler to close this difference.
2025-03-04 13:05:57 -06:00
Simon Quigley
ca217c035e Add a new changelog entry 2025-03-04 13:04:49 -06:00
Simon Quigley
b5e117788b Upload to Unstable 2025-03-01 11:30:18 -06:00
Simon Quigley
ddba2d1e98 Update Standards-Version to 4.7.2, no changes needed. 2025-03-01 11:29:53 -06:00
Simon Quigley
02d65a5804 [syncpackage] Do not use exit(1) on an error or exception unless it applies to all packages, instead return None so we can continue to the next package. 2025-03-01 11:26:59 -06:00
Simon Quigley
bda85fa6a8 [syncpackage] Add support for -y or --yes, noted that it should be used with care. 2025-03-01 11:22:52 -06:00
Simon Quigley
86a83bf74d [syncpackage] Within fetch_source_pkg, do not exit(1) on an error or exception, simply return None so we can continue to the next package. 2025-03-01 11:17:02 -06:00
Simon Quigley
162e758671 [syncpackage] When syncing multiple packages, if one of the packages is in the sync blocklist, do not exit, simply continue. 2025-03-01 11:12:49 -06:00
Simon Quigley
049425adb7 Add debian/files to .gitignore 2025-03-01 11:11:34 -06:00
Simon Quigley
f6ca6cad92 Add a new changelog entry 2025-03-01 11:11:17 -06:00
Simon Quigley
3dc17934d6 Upload to Unstable 2025-02-24 19:55:03 -06:00
Simon Quigley
10a176567a Remove mail line from default ~/.sbuildrc, to resolve the undeclared dependency on sendmail (Closes: #1074632). 2025-02-24 19:52:59 -06:00
Simon Quigley
86b366c6c5 Add a large warning at the top of mk-sbuild encouraging the use of the unshare backend. This is to provide ample warning to users. 2025-02-24 19:15:55 -06:00
Simon Quigley
50b580b30e Add a manpage for running-autopkgtests. 2025-02-24 18:51:12 -06:00
Simon Quigley
6ba0641f63 Rename bitesize to lp-bitesize (Closes: #1076224). 2025-02-24 18:51:10 -06:00
Simon Quigley
1e815db9d2 Add my name to the copyright file. 2025-02-24 18:35:20 -06:00
Simon Quigley
e2f43318bd Add several Lintian overrides related to .pyc files. 2025-02-24 18:34:18 -06:00
Julien Plissonneau Duquène
cdd81232d9 Fix reverse-depends -b crash on packages that b-d on themselves (Closes: #1087760). 2025-02-24 18:31:33 -06:00
Simon Quigley
65044d84d9 Update Standards-Version to 4.7.1, no changes needed. 2025-02-24 18:26:59 -06:00
Mattia Rizzolo
19e40b49c2
Fix minor typo in pbuilder-dist(1)
LP: #2096956
Thanks: Rolf Leggewie for the patch
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2025-01-30 07:52:22 +01:00
Benjamin Drung
55eb521461 Release 0.203 2024-11-02 18:20:32 +01:00
Benjamin Drung
983bb3b70e Depend on python3-yaml for pm-helper 2024-11-02 18:09:16 +01:00
Benjamin Drung
85f2e46f7d conform to snake_case naming style 2024-11-02 18:07:23 +01:00
Benjamin Drung
649c3db767 ubuntu-build: fix used-before-assignment
```
ubuntu-build:244:40: E0601: Using variable 'necessary_privs' before assignment (used-before-assignment)
```
2024-11-02 17:56:47 +01:00
Benjamin Drung
e7ba650414 Avoid unnecessary "elif" after "continue"
Address pylint's no-else-continue.
2024-11-02 17:55:33 +01:00
Benjamin Drung
3bc802a209 Use lazy % formatting in logging functions 2024-11-02 17:55:20 +01:00
Benjamin Drung
92c80d7bb7 ubuntu-build: remove unused code/imports 2024-11-02 17:54:06 +01:00
Benjamin Drung
d7362d9ed8 Use Python f-strings
```
flynt -ll 99 -tc -tj -a pbuilder-dist pm-helper running-autopkgtests ubuntu-build ubuntutools
```
2024-11-02 17:49:20 +01:00
Benjamin Drung
c7a855ff20 Format code with black and isort
```
isort pbuilder-dist pm-helper running-autopkgtests ubuntu-build ubuntutools
black -C pbuilder-dist pm-helper running-autopkgtests ubuntu-build ubuntutools
```
2024-11-02 17:21:30 +01:00
Benjamin Drung
017941ad70 setup.py: add pm-helper 2024-11-02 16:41:44 +01:00
Benjamin Drung
69914f861e add missing files to debian/copyright 2024-11-02 16:35:31 +01:00
Benjamin Drung
454f1e30c8 Bump year in copyright 2024-11-02 15:57:19 +01:00
Benjamin Drung
55bc403a95 Bump Standards-Version to 4.7.0 2024-11-02 15:56:01 +01:00
Benjamin Drung
c9339aeae4 import-bug-from-debian: add type hints 2024-11-02 15:34:59 +01:00
Benjamin Drung
c205ee0381 import-bug-from-debian: avoid type change of bug_num
The variable `bug_num` has the type `str`. Do not reuse the name for
type `int` to ease mypy.
2024-11-02 15:33:15 +01:00
Benjamin Drung
7577e10f13 import-bug-from-debian: reuse message variable
`log[0]["message"]` was already queried.
2024-11-02 15:32:19 +01:00
Florent 'Skia' Jacquet
e328dc05c2 import-bug-from-debian: split big main function into smaller ones
This allows better understanding of the various parts of the code, by
naming important parts and defining boundaries on the used variables.
2024-11-02 15:08:09 +01:00
Florent 'Skia' Jacquet
9a94c9dea1 import-bug-from-debian: handle multipart messages
With multipart messages, like #1073996, `import-bug-from-debian` would
produce bug description with this:
```
[<email.message.Message object at 0x7fbe14096fa0>, <email.message.Message object at 0x7fbe15143820>]
```
For that kind of bug, it now produces a correct description with the
plain text parts concatenated in the description, the attachments added
as attachments, and the inline images converted to attachments with an
inline message placeholder.

See #981577 for a particularly weird case now gracefully handled.
If something weirder happens, then the tool will now abort with a clear
message instead of producing garbage.

Closes: #969510
2024-11-02 14:57:01 +01:00
Florent 'Skia' Jacquet
47ab7b608b Add gitignore 2024-10-30 17:31:54 +01:00
Steve Langasek
56044d8eac Recommend sbuild over pbuilder. sbuild is the tool recommended by Ubuntu developers whose behavior most closely approximates Launchpad builds. 2024-05-26 13:04:55 -07:00
Steve Langasek
c523b4cfc4 open new version 2024-05-26 13:01:23 -07:00
Steve Langasek
3df40f6392 Handle exceptions on retry
The "can be retried" value from launchpad may have been cached.  Avoid an
exception when we race someone else retrying a build.
2024-05-26 12:57:14 -07:00
Simon Quigley
6ebffe3f4a Consolidate Ubuntu changelog entries, upload to Unstable 2024-04-12 23:35:08 -05:00
Chris Peterson
f01234e8a5 update debian/copyright
- Correctly add ISC licenses to new files in ubuntutools/tests/*
  as specified in debian/copyright
- Add GPL-3 licenses and correct attribution for:
    - running-autopkgtests
    - ubuntutools/running_autopkgtests.py
2024-03-13 09:21:30 -07:00
Chris Peterson
43891eda88 depends: python3-launchpadlib-desktop
Replace the dependency on python3-launchpadlib with
python3-launchpadlib-desktop. This package is the same as python3-launchpadlib
except that it also includes python3-keyring, which is a requirement for
some of the desktop-centric code-paths. In the case, requestsync has a
path for logging in via a web browser which also requires python3-keyring
to be installed. This had caused a ModuleNotFoundError when
python3-launchpadlib dropped python3-keyring from Recommends to Suggests
(LP: #2049217).
2024-03-13 09:17:49 -07:00
Steve Langasek
132866e2ba releasing package ubuntu-dev-tools version 0.201ubuntu2 2024-03-12 17:03:58 -07:00
Steve Langasek
a0fcac7777 changelog update 2024-03-12 17:03:41 -07:00
Steve Langasek
490895075d Merge latest Ubuntu upload 2024-03-12 17:01:59 -07:00
Chris Peterson
5186e76d8d Import Debian version 0.201ubuntu1
ubuntu-dev-tools (0.201ubuntu1) noble; urgency=medium
.
  * Replace Depends on python3-launchpadlib with Depends on
    python3-launchpadlib-desktop (LP: #2049217)
2024-03-12 17:01:19 -07:00
Steve Langasek
bf46f7fbc1 Fix license statement in manpage 2024-03-12 12:09:19 -07:00
Steve Langasek
881602c4b9 Update ubuntu-build manpage to match current options 2024-03-12 12:08:58 -07:00
Steve Langasek
c869d07f75 ubuntu-build: don't retry builds Launchpad tells us can't be retried 2024-03-12 11:52:32 -07:00
Gianfranco Costamagna
59041af613 update changelog 2024-03-12 10:39:36 +01:00
Gianfranco Costamagna
0ec53180f2 Merge remote-tracking branch 'vorlon/ubuntu-build-revamp' 2024-03-12 10:36:13 +01:00
Steve Langasek
c92fa6502f ubuntu-build: Handling of proposed vs release pocket default for ppas 2024-03-10 21:43:06 -07:00
Steve Langasek
07d3158ade Don't do expensive check of group membership on rescore, just handle exceptions
This could do with some further refactoring, but will probably postpone that
until a decision is made about dropping the non-batch mode
2024-03-10 16:51:15 -07:00
Steve Langasek
d5faa9b133 Proper handling of getDevelopmentSeries() 2024-03-10 15:48:16 -07:00
Steve Langasek
9e710a3d66 Always use exact match when looking for source packages by name 2024-03-10 15:46:22 -07:00
Steve Langasek
010af53d7c Add a -A archive option to act on ppas as well.
This results in a major refactor of the code to use launchpadlib directly
instead of the ubuntutools.lp.lpapicache module in ubuntu-dev-tools which is
idiosyncratic and does not expose the full launchpad API.  Easier to rewrite
to use the standard library.
2024-03-10 14:35:47 -07:00
Steve Langasek
0bef4d7352 ubuntu-build: fix licensing.
Canonical licensing policy has never been GPLv3+, only GPLv3.
2024-03-10 13:36:30 -07:00
Steve Langasek
688202a7cf ubuntu-build: update copyright 2024-03-10 13:35:56 -07:00
Steve Langasek
691c1381db ubuntu-build: support retrying builds in other states that failed-to-build 2024-03-10 01:45:20 -08:00
Steve Langasek
f01502bda2 ubuntu-build: make the --arch option top-level
This gets rid of the fugly --arch2 option
2024-03-08 18:53:20 -08:00
Steve Langasek
42f8e5c0d2 ubuntu-build: in batch mode, print a count of packages retried 2024-03-08 18:38:59 -08:00
Steve Langasek
bb8a9f7394 ubuntu-build: support --batch with no package names to retry all 2024-03-08 16:43:30 -08:00
Gianfranco Costamagna
a058c716b9 Upload to sid 2024-02-29 22:49:37 +01:00
Chris Peterson
e64fe7e212 Update Changelog 2024-02-29 13:08:13 -08:00
Chris Peterson
f07d3df40c running-autopkgtests: make running-autopkgtests available
Previously running-autopkgtests was added to the source but
wasn't correctly added to the scripts in setup.py, so it wasn't
actually available in the installed package. This also adds the
script to the package description.
2024-02-29 13:06:12 -08:00
Gianfranco Costamagna
f73f2c1df1 Upload to sid 2024-02-15 18:09:28 +01:00
Gianfranco Costamagna
268d082226 Update changelog 2024-02-15 18:06:49 +01:00
Athos Ribeiro
6bc59d789e Log syncpackage LP auth errors before halting 2024-02-15 18:06:38 +01:00
Logan Rosen
9a4cc312f4 Don't rely on debootstrap for validating Ubuntu distro 2024-02-15 17:51:35 +01:00
Ying-Chun Liu (PaulLiu)
ffc787b454 Drop qemu-debootstrap
qemu-debootstrap is deprecated for a while. In newer qemu release
the command is totally removed. We can use debootstrap directly.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2024-02-15 17:49:59 +01:00
Chris Peterson
bce1ef88c5 running-autopkgtests: use f-strings 2024-02-14 15:19:48 -08:00
Chris Peterson
a9eb902b83 running-autopkgtests: Changelog entry, ArgumentParser, refactor, tests
Created a new changelog entry to include addition of the running-autopkgtests
script. This includes a refactor of the original script resulting in a new
module in ubuntutools, test cases, and the addition an argument parser to
allow printing just the queued tests, just the running tests, or both
(default).
2024-02-14 15:19:43 -08:00
Chris Peterson
cb7464cf61 Add running-autopkgtests script
This script will print out all of the running and queued autokpgtests.
Originally this was a script titled lp-test-isrunning
from lp:~ubuntu-server/+git/ubuntu-helpers.
2024-02-14 14:55:33 -08:00
Simon Quigley
19f1df1054 Upload to Unstable 2024-01-29 10:03:47 -06:00
Simon Quigley
7f64dde12c Add a changelog entry for Steve 2024-01-29 10:03:19 -06:00
Simon Quigley
c2539c6787 Add a changelog entry for adding myself to Uploaders. 2024-01-29 09:59:30 -06:00
Simon Quigley
fd885ec239 Merge remote-tracking branch 'vorlon/pm-helper' 2024-01-29 09:57:52 -06:00
Simon Quigley
abbc56e185 Add my name to Uploaders.
To be fair, the last four uploads should have started with "Team upload." Whoops.
2024-01-10 20:21:06 -06:00
Simon Quigley
a2176110f0 Upload to Unstable. 2024-01-10 20:04:15 -06:00
Simon Quigley
a5185e4612 Add proper support for virtual packages in check-mir, basing the determination solely off of binary packages. This is not expected to be a typical case. 2024-01-10 20:03:44 -06:00
Simon Quigley
e90ceaf26b In check-mir, ignore debhelper-compat when checking the build dependencies. This is expected to be a build dependency of all packages, so warning about it in any way is surely a red herring. 2024-01-10 19:56:06 -06:00
Simon Quigley
47fd5d7cca Upload to Unstable. 2023-10-03 14:01:44 -05:00
Simon Quigley
2f396fe549 When using pull-*-source to grab a package which already has a defined Vcs- field, display the exact same warning message apt source does. 2023-10-03 14:01:19 -05:00
Gianfranco Costamagna
5bda35f6b4 Update also syncpackage help 2023-08-25 20:04:12 +02:00
Simon Quigley
db916653cd Update the manpage for syncpackage to reflect the ability to sync multiple packages at once. 2023-08-10 14:39:01 -05:00
Simon Quigley
784e7814e9 Allow the user to sync multiple packages at one time (LP: #1756748). 2023-08-04 14:38:46 -05:00
Simon Quigley
bed2dc470d Add support for the non-free-firmware components in all tools already referencing non-free. 2023-07-26 13:04:12 -05:00
Gianfranco Costamagna
414bc76b50 Upload to Debian 2023-07-08 08:43:09 +02:00
Gianfranco Costamagna
6f0caf1fc0 ubuntu-build: For some reasons, now you need to be authenticated before trying to use the "PersonTeam" class features.
Do it at the begin instead of replicating the same code inside the tool itself.

This fixes e.g. this failure:

./ubuntu-build --batch --retry morsmall
Traceback (most recent call last):
  File "/tmp/ubuntu-dev-tools/ubuntu-build", line 317, in <module>
    main()
  File "/tmp/ubuntu-dev-tools/ubuntu-build", line 289, in main
    can_retry = args.retry and me.canUploadPackage(
AttributeError: 'NoneType' object has no attribute 'canUploadPackage'
2023-07-07 19:23:41 +02:00
Robie Basak
4bcc55372a Changelog for 0.193ubuntu5 2023-07-06 11:28:21 +01:00
Robie Basak
232a73de31 ubuntutools/misc: swap iter_content for raw stream
This is a partial revert of 1e20363.

When downloading a .diff.gz source package file, we do expect it to be
written to disk still compressed. If we were to uncompress it, then we
would get a size mismatch and even if we were to ignore that, we'd get a
hash mismatch.

On the other hand when downloading a changes file we need to make sure
that is written to disk uncompressed.

To make this work in both cases we can ask the HTTP server for no
special content encoding using "Accept-Encoding: identity". This is what
wget requests, for example. Then we can write the output to the file
without performing any decoding at our end by using the raw response
object again.

This fixes both cases.

LP: #2025748
2023-07-06 11:28:21 +01:00
Steve Langasek
9aab0135a2 Add an initial manpage for pm-helper 2023-06-14 17:01:36 -07:00
Steve Langasek
23539f28b1 Update license header 2023-06-14 16:52:56 -07:00
Steve Langasek
4a09d23db6 There is no dry-run mode 2023-06-14 16:29:43 -07:00
Steve Langasek
534cd254f4 typo update-excuses->update-excuse 2023-06-14 15:14:14 -07:00
Steve Langasek
29c3fa98bc Use a context manager for lzma 2023-06-14 15:13:46 -07:00
Steve Langasek
7c9c7f2890 Sensible behavior when called for a non-existent package name 2023-06-14 15:12:57 -07:00
Steve Langasek
739279da3f More pythonic function name (thanks, Bryce) 2023-06-14 14:51:15 -07:00
Steve Langasek
7c11832ee0 Sensible behavior when a requested package isn't in -proposed. 2023-06-14 14:01:53 -07:00
Steve Langasek
f5512846d6 Code refactor; thanks, Bryce 2023-06-14 13:59:25 -07:00
Steve Langasek
9e0dff4461 move from OptionParser to ArgumentParser 2023-06-14 13:57:14 -07:00
Steve Langasek
7129e6e27a Fix imports 2023-06-13 13:57:47 -07:00
Steve Langasek
79d30a9bfc Add dependency on dateutil 2023-06-13 13:52:18 -07:00
Steve Langasek
2c6a8b5451 Initial implementation of pm-helper
This is a tool for making it easier to identify the next thing to work on
for proposed-migration.
2023-06-13 13:48:28 -07:00
Steve Langasek
ad014685ea Import utils.py from ubuntu-archive-tools 2023-06-13 13:47:15 -07:00
Steve Langasek
ff1c95e2c0 Remove references to architectures not supported in any active Ubuntu release. 2023-05-30 21:05:56 -07:00
Steve Langasek
89e788bf48 Remove references to deprecated http://people.canonical.com/~ubuntu-archive. 2023-05-30 19:37:11 -07:00
Steve Langasek
a000e9db5e releasing package ubuntu-dev-tools version 0.193ubuntu4 2023-05-30 10:02:47 -07:00
Steve Langasek
83158d24d9 Merge staged changes 2023-05-30 10:00:57 -07:00
Steve Langasek
6e6e1f1e1a Excise all references to cdbs (including in test cases) 2023-05-30 10:00:17 -07:00
Steve Langasek
c7a7767339 Fix a typo introduced in the last upload that made mk-sbuild fail unconditionally. LP: #2017177. 2023-05-30 09:55:06 -07:00
Steve Langasek
ac2f980e0f Remove references to ftpmaster.internal. When this name is resolvable but firewalled, syncpackage hangs; and these are tools for developers, not for running in an automated context in the DCs where ftpmaster.internal is reachable. 2023-04-12 17:59:40 -07:00
Steve Langasek
ccab82e054 releasing package ubuntu-dev-tools version 0.193ubuntu1 2023-04-12 09:45:23 -07:00
Steve Langasek
2e4e8b35b2 Merge branch 'mk-sbuild-not-automatic' 2023-04-12 09:45:15 -07:00
Steve Langasek
53fcd577e8 We no longer need to run sed 2023-04-12 09:41:52 -07:00
Steve Langasek
8430d445d8 Align with the Launchpad buildd implementation, per review comments 2023-04-12 09:28:41 -07:00
Benjamin Drung
c8a757eb07 Format Python code with black 23.1
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-04-04 12:11:36 +02:00
Nathan Rennie-Waldock
66a2773c1c backportpackage: Fix incorrectly reporting unknown distribution for Ubuntu
Fix incorrectly reporting unknown distribution for Ubuntu after commit
7fc6788b35d32aeb96c7cf81303853d4f31028d1 ("backportpackage: fix
automatic selection of the target release").

LP: #2013237
Signed-off-by: Nathan Rennie-Waldock <nathan.renniewaldock@gmail.com>
2023-04-04 11:50:41 +02:00
Stefano Rivera
17d2770451 Upload to unstable 2023-02-25 13:20:04 -04:00
Stefano Rivera
3136541ca6 Don't run linters at build time, or in autopkgtests. (Closes: #1031436). 2023-02-25 12:52:39 -04:00
Benjamin Drung
f3a0182e1a Release ubuntu-dev-tools 0.192
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-02-01 12:45:31 +01:00
Benjamin Drung
6498a13f18 Drop unneeded X-Python3-Version from d/control
lintain says: "Your sources request a specific set of Python versions
via the control field X-Python3-Version but all declared autopkgtests
exercise all supported Python versions by using the command py3versions
--supported."

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-02-01 12:43:00 +01:00
Benjamin Drung
d2debf9ed9 Update year in debian/copyright
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-02-01 12:40:33 +01:00
Benjamin Drung
a11cb1f630 Bump Standards-Version to 4.6.2
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-02-01 12:39:50 +01:00
Benjamin Drung
34578e6a1e Enable more pylint checks
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-02-01 12:07:19 +01:00
Benjamin Drung
21784052ba test: Fix deprecated return value for test case
```
ubuntutools/test/test_archive.py::LocalSourcePackageTestCase::test_pull
  /usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method LocalSourcePackageTestCase.test_pull of <ubuntutools.test.test_archive.LocalSourcePackageTestCase testMethod=test_pull>>)
    return self.run(*args, **kwds)
```

`test_pull` does not need to be run directly. Make it private.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 17:39:12 +01:00
Benjamin Drung
aa556af89d Use f-strings
pylint complains about C0209: Formatting a regular string which could be
a f-string (consider-using-f-string)

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 19:32:58 +01:00
Benjamin Drung
069a6926c0 Implement conventions found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 17:28:33 +01:00
Benjamin Drung
444b319c12 Implement refactorings found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 16:58:24 +01:00
Benjamin Drung
4449cf2437 Fix warnings found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 15:51:29 +01:00
Benjamin Drung
9fa29f6ad5 fix(reverse-depends): Restore field titles format
Commit 90e8fe81e1b2610e352c82c0301076ffc7da5ac0 renamed `print_field` to
`log_field`, but changed the `print_field` call with `Logger.info`.
Therefore the line with `=` was lost.

Restore the previous formatting.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 14:42:22 +01:00
Benjamin Drung
a160def2ab fix(requestbackport): Remove useless loop from locate_package
Commit 0f3d2fed2a4ed67b90b5d49aab25ca2bda5d9d37 removed the difference
between the two loop iterations in `locate_package`. So drop the useless
second iteration.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 14:35:12 +01:00
Benjamin Drung
909d945af4 Replace deprecated optparse with argparse
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 13:33:18 +01:00
Benjamin Drung
f6fde2e217 fix: Use lazy % formatting in logging functions
pylint complains about W1201: Use lazy % formatting in logging functions
(logging-not-lazy) and W1203: Use lazy % formatting in logging functions
(logging-fstring-interpolation).

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 11:13:07 +01:00
Benjamin Drung
17bed46ffb feat: Add some type hints
Add some type hints to satisfy mypy.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 10:35:22 +01:00
Benjamin Drung
72add78e9d Fix errors found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 10:19:24 +01:00
Benjamin Drung
ab64467f33 Run pylint during package build again
Commit ae74f71a1e9d4be043162b19d23f2d44c964c771 removed the pylint unit
test saying that unit tests are not needed to just run flake8 or pylint.

Since pylint is useful, add it back, but this time call it directly and
not embed it into a unit test.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 00:05:15 +01:00
Benjamin Drung
b1bc7e1cdc Address pylint complaints
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 23:10:31 +01:00
Benjamin Drung
8692bc2b1c refactor(setup.py): Introduce get_debian_version
Move getting the Debian package version into a separate function and
fail in case it cannot find it or fails parsing it.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 21:56:37 +01:00
Benjamin Drung
a685368ae9 Run isort import sorter during package build
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 21:34:24 +01:00
Benjamin Drung
4e27045f49 style: Sort Python imports with isort
```
isort -l 99 --profile=black .
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 21:28:47 +01:00
Benjamin Drung
db0e091e44 Run black code formatter during package build
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:48:49 +01:00
Benjamin Drung
3354b526b5 style: Format Python code with black
```
PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .)
black -C -l 99 . $PYTHON_SCRIPTS
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:45:36 +01:00
Benjamin Drung
79d24c9df1 fix: Check Python scripts with flake8 again
Commit ae74f71a1e9d4be043162b19d23f2d44c964c771 removed the flake8
unittest and commit 3428a65b1cd644445f55ad8ae65ece5f73d7acb5 added
running flake8 again, but only for files named `*.py`.

Check also all Python scripts with a Python shebang.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:29:51 +01:00
Benjamin Drung
932166484b Fix issues found by flake8 on the Python scripts
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:29:30 +01:00
Benjamin Drung
bd770fa6b1 test: Do not run flake8 in verbose mode
The verbose output of flake8 is not interesting and just clutters the
output.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 14:11:09 +01:00
Benjamin Drung
3d54a17403 refactor: Move linter checks into run-linters script
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 14:10:02 +01:00
Benjamin Drung
3bdb827516 fix: Use PEP440 compliant version in setup.py
Versions like `0.176ubuntu20.04.1` in Ubuntu are clearly not compliant
with https://peps.python.org/pep-0440/. With setuptools 66, the versions
of all packages visible in the Python environment *must* obey PEP440.

Bug: https://launchpad.net/bugs/1991606
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 14:07:23 +01:00
Mattia Rizzolo
0d94b5e747
document the last commit
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2023-01-15 18:16:07 +01:00
Krytarik Raido
0f3d2fed2a
requestbackport: Adapt to new backports policy (LP: #1959115)
As documented on <https://wiki.ubuntu.com/UbuntuBackports>

Template update done by Unit 193.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2023-01-15 18:14:48 +01:00
Mattia Rizzolo
844d6d942c
Merge branch 'mk-sbuild' of git+ssh://git.launchpad.net/~myamada/ubuntu-dev-tools
Closes: #1001832
LP: #1955116
MR: https://code.launchpad.net/~myamada/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/435734
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2023-01-14 18:49:29 +01:00
Mattia Rizzolo
ae43fd1929
document the previous changes
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2023-01-14 18:46:50 +01:00
Masahiro Yamada
69ac109cdb mk-sbuild: fix security update repository for Debian bullseye and later
If I run "apt-get update" in the bullseye chroot, I get the following error:

  Err:4 http://security.debian.org bullseye-updates Release
    404  Not Found [IP: 2a04:4e42:600::644 80]

It looks like the directory path was changed since bullseye.

buster:

    deb https://security.debian.org/debian-security buster/updates main

bullseye:

    deb https://security.debian.org/debian-security bullseye-security main

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
2023-01-13 18:53:17 +09:00
Masahiro Yamada
9f2a53c166 mk-sbuild: add debian_dist_ge()
Add debian_dist_ge(), which will be used by the next commit.

To avoid code duplication, move the common part to dist_ge().

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
2023-01-13 18:34:01 +09:00
Steve Langasek
a69c40d403 Set up preferences for -proposed with NotAutomatic: yes
As of lunar, Ubuntu sets NotAutomatic: yes for its -proposed pockets.  For
sbuild chroots, we want to continue to explicitly install from -proposed by
default; so override with apt preferences to get the correct behavior.
2022-11-16 17:49:13 -08:00
Benjamin Drung
c1e4b14a98 Demote bzr/brz from Recommends to Suggests
Nowadays git is used nearly everywhere. Therefore demoting bzr/brz to
Suggest is the right thing to do.

Bug-Debian: https://bugs.debian.org/940531
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2022-11-16 18:49:42 +01:00
Benjamin Drung
096d5612e7 sponsor-patch: Use --skip-patches when extract source package
Use `--skip-patches` when extract source packages with `dpkg-source`.
`--no-preparation` is a source package build option and `--skip-patches`
is the correct extract option.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2022-11-16 18:37:56 +01:00
Benjamin Drung
b510dbd91e sponsor-patch: Ignore exit code 1 of debdiff call
sponsor-patch calls `debdiff` which exits with 1 if there are
differences. So accept exit codes 0 and 1 as expected.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2022-11-15 16:43:27 +01:00
Mattia Rizzolo
803949ed8b
also include a lp bug number there
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-10-11 14:42:08 +02:00
Mattia Rizzolo
e219eaa5fc
Open changelog for the next release.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-10-11 13:58:00 +02:00
Mattia Rizzolo
60ee986014
Release 0.191
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-10-11 13:56:13 +02:00
Mattia Rizzolo
dabe475067
ubuntutools/archive.py: fix crash in SourcePackage()._source_urls()
Fix operation of SourcePackage._source_urls() (as used, for example, in
SourcePackage.pull() called by backportpackage) to also work when the
class is instantiated with a URL as .dsc.

This is a regression caused by 1b12d8b4e3315de3bf417b40a3c66279f309d72c
(first in v0.184) that moved from os.path.join() to Pathlib, but
os.path.join() was also used to join URLs.

Thanks: Unit 193 for the initial patch.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-09-29 10:34:51 +02:00
Mattia Rizzolo
0a9e18ed91
document the previous change
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-09-29 10:32:07 +02:00
Stefano Rivera
7859889438 backportpackage: Add support for lsb-release-minimal, which doesn't have a Python module, thanks Gioele Barabucci. (Closes: 1020901) 2022-09-28 11:40:33 +02:00
Gioele Barabucci
a3c87e78aa backportpackage: Run lsb_release as command if the Python module is not available 2022-09-28 11:36:22 +02:00
Mattia Rizzolo
05af489f64
Merge branch 'lp1984113' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/428101
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-08-22 17:57:07 +02:00
Mattia Rizzolo
d5fdc00396
open changelog for the next release
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-08-22 17:56:02 +02:00
Dan Streetman
7d278cde21 ubuntu-build: use correct exception from LP login failure 2022-08-09 12:15:09 -04:00
Dan Streetman
ad402231db ubuntu-build: explicitly login to LP
LP: #1984113
2022-08-09 12:14:56 -04:00
Dan Streetman
562e6b13cd lpapicache: force lp access on login to workaround possibly invalid cached creds 2022-08-09 12:08:50 -04:00
Dan Streetman
9c1561ff26 lpapicache: remove try-except around login that only logs the error and then re-raises 2022-08-09 12:07:31 -04:00
Benjamin Drung
06a04f642f Release ubuntu-dev-tools 0.190
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
2022-06-16 10:55:29 +02:00
Benjamin Drung
8f0005ce1d Bump Standards-Version to 4.6.1
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
2022-06-16 10:54:41 +02:00
Benjamin Drung
51ebfb21d3 Add missing files to debian/copyright
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
2022-06-16 10:52:51 +02:00
Benjamin Drung
f83161dcc2 Wrap long line in setup-packaging-environment.1
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
2022-06-16 10:24:32 +02:00
Benjamin Drung
bf5796c69e mk-sbuild: Rename SCRIPT to DEBOOTSTRAP_SCRIPT
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
2022-06-16 10:20:22 +02:00
Gianfranco Costamagna
214da052b2 pbuilder-dist: fix typo kernal/kernel 2022-06-13 10:09:24 +02:00
Mattia Rizzolo
b9c9a21696
Merge branch 'unknown-ubuntu-script' of git+ssh://git.launchpad.net/~xnox/ubuntu-dev-tools
MR: https://code.launchpad.net/~xnox/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/420623
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-05-01 14:40:23 +02:00
Dimitri John Ledkov
1f3e4a5ad7
mk-sbuild: build Ubuntu chroots for unknown new releases
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2022-04-27 14:18:15 +01:00
Mattia Rizzolo
835fe258ab
open changelog for the next release
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-04-04 15:05:49 +02:00
Mattia Rizzolo
5618358870
Release 0.189
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-04-04 15:03:39 +02:00
Mattia Rizzolo
d1de55b320
Merge branch 'master' of git+ssh://git.launchpad.net/~tobhe/ubuntu-dev-tools
MR: https://code.launchpad.net/~tobhe/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/416458
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-04-04 14:56:38 +02:00
Matthias Klose
87858a4387 mk-sbuild: don't require pkg-config-$target_tuple
Packages pkg-config-$target_tuple are no longer built by from source
package gcc-defaults-ports. Install pkg-config instead (LP: #1966881).
2022-03-30 15:37:08 +02:00
Tobias Heider
cb48d71056 mk-sbuild: document SCHROOT_TYPE zfs in the manpage 2022-03-07 14:08:23 +01:00
Mattia Rizzolo
b2d259b415
init changelog for the next release
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-02-07 16:32:07 +01:00
Mattia Rizzolo
533b9535aa
Changelog for 0.188
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-02-07 16:30:14 +01:00
Mattia Rizzolo
7d3ea739a2
close a bug in the changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-02-07 16:19:47 +01:00
Mattia Rizzolo
c53750694f
document the last change
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2022-01-20 15:41:55 +01:00
Graham Inggs
0dde3262d1
ubuntutools/lp: Python 3.10 compatibility 2022-01-20 15:38:03 +01:00
Mattia Rizzolo
3a903ca628
archive.py: support python 3.6
this is needed for the backports to bionic

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-09 17:56:50 +01:00
Mattia Rizzolo
c7058559c5
Changelog for 0.187
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:58:23 +01:00
Mattia Rizzolo
13123c51c6
Merge branch 'cleanup' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/412242
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:58:06 +01:00
Mattia Rizzolo
009b79224f
backportpackage: also close a debian bug
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:49:53 +01:00
Mattia Rizzolo
7fc6788b35
backportpackage: fix automatic selection of the target release.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:49:31 +01:00
Mattia Rizzolo
3ef7c4a569
backportpackage: add a full stop after the changelog line :3
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:44:02 +01:00
Mattia Rizzolo
cd4d717551
backportpackage: change the ubuntu backports version following the new policy from the Backporters team
Thanks: Unit 193 for the patch
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:43:51 +01:00
Mattia Rizzolo
d903160215
backportpackage: slight refactor for the debian versioning handler
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-12-05 15:42:11 +01:00
Dan Streetman
8fe22fbbb6 Remove hugdaylist script
The last email announcing a 'hug day' appears to have been over
5 years ago, and the hugdaylist script doesn't seem to work
right anymore anyway.

This also removes ubuntutools/lp/libsupport, which has no functions
used by anything else.
2021-11-22 13:00:52 -05:00
Dan Streetman
06038060b0 update changelog 2021-11-19 08:22:07 -05:00
Dan Streetman
4d72d184db pullpkg: change pull_upload_queue params into specific keyword-only params 2021-11-19 08:11:31 -05:00
Dan Streetman
20261960f6 pullpkg: unpack downloaded src from upload queue 2021-11-19 08:11:31 -05:00
Dan Streetman
d05e023dfe ubuntutools: don't sys.exit if unpack fails, just log it 2021-11-19 08:11:31 -05:00
Dan Streetman
de295fe524 ubuntutools/misc: return dst Path object from download() 2021-11-19 08:11:31 -05:00
Dan Streetman
1e2036399e ubuntutools/misc: use iter_content instead of raw stream access
Reading the raw stream doesn't decode files that are content-encoded,
which is true for the 'changes' file from launchpad, so it's saved
to disk gzipped which isn't what is expected.

Using the python requests iter_content method instead uses the
built-in stream decoding that the requests library provides, and
saves the file uncompressed/unencoded.

Note that since the encoded Content-Length won't match the resulting
unencoded actual length of data we save to file, this also turns off
the progress bar for any files that have Content-Encoding.
2021-11-19 08:11:31 -05:00
Dan Streetman
85125e3c90 ubuntutools/misc: allow specifying blocksize to download methods 2021-11-19 08:11:15 -05:00
Dan Streetman
cfa45994d0 ubuntutools/misc: create helper class to display download progress bar 2021-11-19 08:09:08 -05:00
Mattia Rizzolo
a74a49fb81
backportpackage: Support backporting to Debian releases. LP: #974132
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-10-31 16:47:43 +01:00
Peter Pentchev
74867c90f4
mk-sbuild: Fix a check for TARGET_ARCH in a message.
Closes: #968316
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-10-31 16:34:00 +01:00
Mattia Rizzolo
b904993e05
Merge branch 'mk-sbuild-zfs' of git+ssh://git.launchpad.net/~paride/ubuntu-dev-tools
MR: https://code.launchpad.net/~paride/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/409346
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-10-31 16:31:39 +01:00
Mattia Rizzolo
000d3c1c2d
open changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-10-31 16:25:12 +01:00
Stefano Rivera
9a44175a17 Upload to unstable 2021-10-24 16:13:01 -07:00
Stefano Rivera
a9e2a2689d Replace nose with pytest (see: #997758). 2021-10-24 16:05:08 -07:00
Paride Legovini
fec7a72ef7 mk-sbuild: add support for zfs-snapshot schroots
Creating datasets with mountpoint=legacy is necessary because the
schroot helper scripts expect it. This will make zfs-snapshot schroots
behave more like lvm-snapshot schroots and less like btrfs-snapshot
schroots (e.g. the source schroot is not permanently mounted/visible).

Switching mount "style" requires changes in at least the
/etc/schroot/setup.d/05zfs and 10mount scripts.

LP: #1945349
2021-09-28 19:59:42 +02:00
Stefano Rivera
9360b17bcb Upload to unstable 2021-09-17 15:53:13 -07:00
Stefano Rivera
5eeb707142 Bump Standards-Version to 4.6.0, no changes needed. 2021-09-17 15:52:51 -07:00
Stefano Rivera
c1b1c106dc Update changelog 2021-09-17 15:52:51 -07:00
Dan Streetman
266085d587 misc: fix flake8 complaints 2021-09-17 07:25:47 -04:00
Dan Streetman
6ca12331d6 archive: use proper component
source packages sometimes have different component than their
bpphs, so use the correct component when downloading binaries

LP: #1943819
2021-09-16 21:01:19 -04:00
Dan Streetman
5fcc4b5b46 misc: handle ConnectionError as NotFoundError 2021-09-16 20:29:14 -04:00
Dan Streetman
a3ff68be5a misc: download to tmp file, to avoid leftover 0-size file on error 2021-09-16 19:24:00 -04:00
Krytarik Raido
a1b56ac31f
merge-changelog: Fix setting of newlines.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-09-08 19:44:15 +02:00
Mattia Rizzolo
ceb020d0fa
lpapicache: fix sorting in Archive.getUploadersForPackage().
LP: #1862372
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-17 15:55:14 +02:00
Mattia Rizzolo
fbbcee9cc1
reflow code for the next commit
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-17 15:51:23 +02:00
Mattia Rizzolo
511aa3d80c
Merge branch 'fix-ppa-pull-lp-1938659' of git+ssh://git.launchpad.net/~alexmurray/ubuntu-dev-tools
MR: https://code.launchpad.net/~alexmurray/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/406518
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-04 12:02:46 +02:00
Mattia Rizzolo
6c8109b6ae
init changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-04 11:59:24 +02:00
Alex Murray
296e498fe9
archive: Fix PersonalPackageArchiveSourcePackage to yield URLs
Yielding the result of super()_source_urls() / _binary_urls() yields the
generator object itself which generates the list of URLs - not the URLs
which would be returned from this generator. Instead use yield from which
forwards the yield onto the generator object itself.

Fixes LP: #1938659

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2021-08-03 10:39:55 +09:30
Mattia Rizzolo
3f0d63d5b6
Release 0.184
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-07-17 17:57:22 +02:00
Mattia Rizzolo
49527c36e1
d/control: Bump debhelper compat level to 13.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-07-17 17:56:30 +02:00
Mattia Rizzolo
14a8005d45
d/control: remove redudant Recommends that are already in Depends.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-07-17 17:56:08 +02:00
Mattia Rizzolo
52032eb081
Merge branch 'ccache-support' of git+ssh://git.launchpad.net/~3v1n0/ubuntu-dev-tools
MR: https://code.launchpad.net/~3v1n0/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/401817
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-07-17 17:54:04 +02:00
Mattia Rizzolo
4fc36efcf2
pbuilder-dist: use shutil.which instead of distutils.spawn.find_executable() to save a dependency
LP: #1936697
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-07-17 17:47:51 +02:00
Dan Streetman
7f227f6264 update changelog 2021-07-14 17:53:26 -04:00
Dan Streetman
d598900df7 d/control: remove no longer needed requirements
Nothing uses termcolor or yaml anymore in the code
2021-07-14 17:41:10 -04:00
Dan Streetman
b4ca04efaa test: fix archive tests
Assumptions were made about the implementation by mocking
that are no longer true, and the tests generally need to be
fixed to be more robust about testing
2021-07-14 17:41:10 -04:00
Dan Streetman
0eaf71737d test: fix example package class
this class can be much simpler and more robust and doesn't require
checking in the example package files to git
2021-07-14 17:41:10 -04:00
Dan Streetman
1b12d8b4e3 archive: convert to use pathlib instead of os.path
Mostly convert to using pathlib
2021-07-14 17:41:10 -04:00
Dan Streetman
be6e09a02b archive: don't use existing file if no verification methods provided
we shouldn't use an existing file if we aren't checking its checksums
2021-07-14 17:41:10 -04:00
Dan Streetman
86276665cd archive: Update PersonalPackageArchiveSourcePackage to handle private PPA
Unfortunately private PPAs require downloading files from the special server
private-ppa.launchpad.net, and all the usual urls provided by the LP api fail.
So add code to handle using those custom private URLs, and use authentication
when downloading.
2021-07-14 17:41:10 -04:00
Dan Streetman
3f2983c157 misc: Change download() method to use python requests and optional authentication
Since private PPAs require authentication, use python requests library instead
of urlopen(), since requests handles authentication easily
2021-07-14 17:41:10 -04:00
Dan Streetman
4f6d6bf2d8 misc: add extract_authentication method
This pulls the username:password out of a URL
2021-07-14 17:41:10 -04:00
Dan Streetman
df93a225a8 misc: replace os.path with Pathlib
also change some strings to use f-strings
2021-07-14 17:41:10 -04:00
Dan Streetman
d8df8cc869 misc: add download_bytes() and deprecate mode param for download_text()
Passing 'mode' assumes use of open(), but callers don't care about
implementation, just if the returned object is text or bytes
2021-07-14 17:41:04 -04:00
Dan Streetman
243a728d6c Move DownloadError into ubuntutools/misc 2021-07-13 14:08:59 -04:00
Dan Streetman
6e18d60de4 lpapicache: add Archive.getMySubscriptionURL()
Private PPA require using username/password to access their files,
so make this information available. This gets the currently logged in
user's "subscription URL", which includes the authentication data.
2021-07-13 07:55:02 -04:00
Dan Streetman
dbd453876e flake8 tests no longer need to specifically exclude ubuntu-archive-assistant
Now that ubuntu-archive-assistant is removed, we can simply test everything
with flake8
2021-07-12 12:45:27 -04:00
Dan Streetman
732ff00cac Completely remove ubuntu-archive-assistant code
This hasn't been updated even a single time since it was added without
review almost 3 years ago. It additionally has never been included in the
ubuntu-dev-tools package. It's unclear if anyone is using it for anything,
but in any case it certainly shouldn't be in the ubuntu-dev-tools repository.
2021-07-12 12:45:27 -04:00
Marco Trevisan (Treviño)
2ac69a89e3 mk-sbuild: Add support to configure ccache for each schroot
ccache can help greatly in speeding up recompilations in sbuild, but it
is a bit annoying to configure at each schroot creation.

So, add --cache option (and relative CCACHE config parameter) to
configure ccache for sbuild schroots.

By default we use a shared ccache directory, but each schroot can use
a customized one if needed (with local parameters) by using --cache-dir
(or CCACHE_DIR).

Default ccache max-size is 4G, but can be configured with --ccache-size
(or CCACHE_SIZE), the size value is applied to each ccache path, so can
be shared by multiple schroots or applied to a single one.
2021-06-15 02:24:16 +02:00
Marco Trevisan (Treviño)
4e5e6efdb1 mk-sbuild: Enable debugging in the finish.sh script if --debug is used 2021-06-15 02:23:05 +02:00
Marco Trevisan (Treviño)
e193c30695 mk-sbuild: Use a more maintainable OPTS list using a bash array 2021-06-15 02:23:05 +02:00
Stefano Rivera
6bf3640e8f Upload to unstable 2021-06-08 10:09:16 -04:00
Dan Streetman
5dcde81c58 pbuilder: include missing import
commit d784fea1cdf50ca8d80fe2a0074aeb96ab1b580f did not include the
import for 'suppress'
2021-06-06 21:16:44 -04:00
Stefano Rivera
30abe6eacd Upload to unstable 2021-06-06 19:52:25 -04:00
Stefano Rivera
c0546396bf Respect nocheck in DEB_BUILD_OPTIONS, again. 2021-06-06 19:52:14 -04:00
Dan Streetman
ef100f6166 update changelog 2021-06-04 12:26:32 -04:00
Dan Streetman
3428a65b1c d/rules: override build tests to use flake8 and nosetests3 2021-06-04 12:25:21 -04:00
Dan Streetman
91e0babd93 d/t/control: add minimum version requirement for flake8 test
the --extend-exclude parameter was added in flake8 3.8.0
2021-06-04 12:25:21 -04:00
Dan Streetman
952b331c22 archive: fix flake8 test failure 2021-06-04 12:14:10 -04:00
Dan Streetman
e44bc63209 update changelog 2021-06-02 14:57:27 -04:00
Dan Streetman
c2ea95c067 syncpackage: don't login to LP if using --simulate
No need to login to LP if no real action is being taken.
2021-06-02 14:55:17 -04:00
Dan Streetman
f25f815bef update changelog 2021-06-02 11:49:20 -04:00
Dan Streetman
a0315dac8c archive: only download dsc file to the workdir from pull() method
LP: #1928946
2021-06-02 11:24:53 -04:00
Dan Streetman
ec36c7c792 syncpackage: remove calls to no-op pull_dsc() 2021-05-28 16:24:53 -04:00
Dan Streetman
9be49e7b93 archive: deprecate poorly-named pull_dsc() method 2021-05-28 16:24:15 -04:00
Dan Streetman
90824e056c archive: move check for verify_signature into check_dsc_signature 2021-05-28 16:18:50 -04:00
Dan Streetman
1093c372eb archive: allow passing absolute path to _download_file 2021-05-28 16:17:29 -04:00
Dan Streetman
ff66707a4c Add mode param to download_text() to allow using custom modes like 'rb' 2021-05-28 16:14:51 -04:00
Mattia Rizzolo
128eca1a5b
Changelog for 0.181
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-05-02 20:04:32 +02:00
Mattia Rizzolo
4f10be3f13
mk-sbuild: document eatmydata in the manpage
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-05-02 20:02:47 +02:00
Mattia Rizzolo
b687e11813
Merge branch 'fix-backportpackage' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
Closes: https://bugs.debian.org/983854
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/400848
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-05-02 19:55:44 +02:00
Mattia Rizzolo
eca442bf35
Merge branch 'lp1916633' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/399686
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-05-02 19:49:03 +02:00
Marco Trevisan (Treviño)
ede8a77718 doc/mk-sbuild.1: Add documentation for --debootstrap-proxy and DEBOOTSTRAP_PROXY
LP: #1926166
2021-04-26 20:33:48 +02:00
Dan Streetman
85ed9ad1ce backportpackage: don't use SourcePackage() directly
As the warning from 2010 says, don't use this class directly.
2021-04-08 22:52:20 -04:00
Balint Reczey
f97b19554f Use eatmydata by default
Since only the dpkg is wrapped in eatmydata it should be the safe and fast
default. Eatmydata is widely used around apt thus it should be a serious bug
if a package can't be installed with eatmydata in use.
2021-03-26 15:41:10 +01:00
Balint Reczey
a5ee35c812 Use eatmydata only with the dpkg command
Eatmydata wrapping the build as well could break tests.

Thanks: Julian Andres Klode for suggesting this solution
2021-03-26 15:40:25 +01:00
Dan Streetman
d784fea1cd pbuilder: handle debian change from /updates to -security
starting in bullseye, the security suite is -security instead of /updates

LP: #1916633
2021-03-12 13:09:17 -05:00
Krytarik Raido
728849964e
Logging: Fix oversight from the last logging refactor
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-02-24 14:26:18 +01:00
Mattia Rizzolo
09537bd44d
Merge branch 'fix-sponsor-patch' of git+ssh://git.launchpad.net/~logan/ubuntu-dev-tools
MR: https://code.launchpad.net/~logan/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/398509
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-02-24 14:24:50 +01:00
Mattia Rizzolo
484a668c0a
init changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-02-24 14:23:42 +01:00
Logan Rosen
bc24ef23de sponsor-patch: fix bugs from py3 migration 2021-02-22 22:24:52 -05:00
Mattia Rizzolo
ea549d6c19
Changelog for 0.180
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-02-19 12:36:01 +01:00
Mattia Rizzolo
7118411b89
Drop coverage in the autopkgtest, as python3-nose-cov is not in Debian
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-02-19 12:12:02 +01:00
Dan Streetman
2c6f87acd3 update changelog for 0.179 2021-02-03 10:21:50 -05:00
Dan Streetman
211416d2fd update changelog 2021-02-02 06:26:08 -05:00
Dan Streetman
0eeb93ee0c logging: update ubuntutools.getLogger() to output to stdout/stderr correctly
Python logging by default sends all output to stderr, but that's not what
normal programs usually do and is not expected for these scripts.

Change the ubuntutools.getLogger() method to return a logger with handlers
correctly set up to send INFO level (or lower) logs to stdout and WARNING
level (or higher; technically INFO+1 level or higher) logs to stderr.

This results in normally logged output going to stdout and warnings/errors
going to stderr, as expected.
2021-02-02 06:25:12 -05:00
Dan Streetman
b35712fa40 archive: wrap filtered masters in list
LP: #1913330
2021-02-02 06:25:12 -05:00
Dan Streetman
ee9b8756d9 archive: make SourcePackage ABC abstract class to enforce subclasses provide distribution 2021-02-02 06:25:12 -05:00
Dan Streetman
9792f5b95c archive: don't download from archive if using UCA staging ppa
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
d8d4fd9285 archive: log warnings around 'staging' pocket
The 'staging' pocket contains binaries that don't match published binaries,
so log a warning if we fallback to that pocket, and log a warning if pulling
binaries using that pocket.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
9a38ad1b7b archive: add UCA parsing/finding code for UCA releases/pockets
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
db181f4aa6 archive: use UCA Project to find valid UCA release names
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
04ae04e17b archive: simplify PPA source package class
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
ae3837be1d lp: add Project and ProjectSeries classes
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
20036e6c36 ubuntutools/pullpkg: add --login parameter
Just in case we want to pull from a private ppa...

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
e13a4eb45e ubuntutools/archive: deprecate passing 'lp' object to SourcePackage()
There is no point to doing this, as the Launchpad object is a singleton;
the caller should just call Launchpad.login_with() directly and leave
the SourcePackage class out of it.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
cb865e3b86 ubuntutools/lp: change default login to anonymous
If not specified, default to logging in anonymously.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
61f0023c37 archive: use verify_file_checksums()
This reduces duplicate verification steps, and results in logging
error from the verification function if there is a size mismatch,
instead of the silent verification failure that was present in case
neither sha checksum was provided.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
e5a42b1ba1 misc: add verify_file_checksums() function
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
359cb18d8d lpapicache: replace httplib2 use with call to download_text()
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
b89ad962f4 misc: add download_text() method
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
58ca95e719 pullpkg: provide dst to download()
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
a26a154bc9 misc: move logic into download() to handle plain file paths, and src == dst
Update download() function to handle src of plain path, by prepending
'file://' to it.  Also handle the case of src and dst pointing to the same
file.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
fed562405d archive: simplify handling of dsc file
There are only 2 options for getting the dsc file:
1) it's provided as 'dscfile' param
2) we look it up via lp_spph

For case #1, update the constructor to immediately read the provided file
to create the self._dsc object, and set package and version from that.

For case #2, simplify various functions to simply use the normal
_download_file_from_urls() function to get the dsc file from the
normal locations (mirrors, masters, directly from lp), using the same
process as any other file, including checking checksum(s).

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
248cf38d79 misc: update download() function
-require 'dst' parameter
-allow 'dst' parameter to be dir or dest file
-use contextlib.suppress instead of try/except/pass

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
3d0921ee54 archive: simplify _source_urls() and _binary_urls()
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
c29b660dbf lpapicache: make sure source/binary file metadata includes all keys
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
b2f4ceee8e archive: use _download_file_from_urls()
Both pull() and pull_binaries() are changed to use the common function.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
b6e0b5b388 archive: add _download_file_from_urls()
This will consolidate the download functionality from pull() and
pull_binaries()

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
494e0d6ddd archive: change log level of some messages
Change some messages to the correct log level for their importanance.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
2cfcbdb300 Remove pull-revu-source
This script used a website that no longer exists.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
07d7381b4d Remove reverse-build-depends
It's been warning about its deprecation since 2012.  Time to do it.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
d19ac157b0 mk-sbuild: don't print usage on stderr
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
6698b70f98 d/t/control: change to test with flake8 and nosetests
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
d464c1ffe8 d/rules: override dh_auto_clean to cleanup tox and nose coverage files
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
42c659555c d/control: remove flake8 dep
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
120f15ca50 d/control: remove pylint dep
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
4e63b2cbb5 d/control: add dput dependency, remove runtime check
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
f2118d6e7f d/control: add python3-debianbts dep, remove runtime check
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
52739e44ad test: simplify test_help with subtests
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
12c2e6bf42 test: remove unneeded stuff in test/__init__.py
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
ae74f71a1e test: remove flake8 and pylint unittest files
unit tests aren't needed just to run flake8 or pylint.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
930c05621e test: move tests/* into ubuntu_archive_assistant/
This single test is part of ubuntu-archive-assistant, and fails several
flake8 tests; throw it in with the rest, so it's ignored by flake8.

None of it is actually shipped.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
48c7130008 test: remove dep on mock, use unittest.mock instead
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
3eefdec9b6 test: add support for running tox tests
Setup tox to run both flake8 and nosetests

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Stefano Rivera
e7f0447342 Close LP: #1913330 2021-02-01 17:33:10 -07:00
Stefano Rivera
90cb51becb archive.py: Evaluate the filter() fixing syncpackage. 2021-01-29 22:18:22 -07:00
Dimitri John Ledkov
e54a13743c
releasing package ubuntu-dev-tools version 0.178 2021-01-25 23:28:38 +00:00
Dan Streetman
07b81efd24 doc: update pull-pkg man page to clarify default pockets
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-01-22 17:14:28 -05:00
Dan Streetman
390be3f0b3 archive: remove DebianSourcePackage.pull_dsc()
No longer necessary to override this function as the superclass
now does everything the subclass function does.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-01-22 16:19:49 -05:00
Mattia Rizzolo
9d7ce2745f
Merge branch 'pbuilder-dist_more_archs' of git+ssh://git.launchpad.net/~misterc/ubuntu-dev-tools
MR: https://code.launchpad.net/~misterc/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/379692
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-01-19 23:36:25 +01:00
Mattia Rizzolo
f8c0d87b6f
Merge branch 'fix-pull-pkg' of git+ssh://git.launchpad.net/~xnox/ubuntu-dev-tools
MR: https://code.launchpad.net/~xnox/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/396459
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-01-19 23:31:03 +01:00
Dimitri John Ledkov
02c531dfb5
archive.py: use Regular, Ports, and Internal mirrors by default. Thus enabling pull-lp-debs to work with ports architectures, and inside launchpad builds too. 2021-01-19 10:43:48 +00:00
Dimitri John Ledkov
5a428b462d
config.py: add UBUNTU_INTERNAL_MIRROR option, for launchpad internal mirror. 2021-01-19 10:43:47 +00:00
Dimitri John Ledkov
6cc8040510
pullpkg.py: fix --mirror option parsing. 2021-01-19 10:43:46 +00:00
Michael R. Crusoe
5856b6a41f
Use arch-test to determine local arch support
Will work with qemu-user-static, if installed
2021-01-19 10:50:40 +01:00
Mattia Rizzolo
d3a7eac62f
backportpackage: Add a -e/--message option to change the default "No-change" in "No-change backport to DIST".
Thanks to Unit 193 for the initial patch.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-01-14 15:03:28 +01:00
Mattia Rizzolo
a75fb35fc8
ubuntu-archive-assistant/mir: Fix a SyntaxWarning. 2020-12-27 11:43:47 +01:00
Mattia Rizzolo
c5b5d554bc
Merge branch 'lp-1193941' of git+ssh://git.launchpad.net/~logan/ubuntu-dev-tools
MR: https://code.launchpad.net/~logan/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/395616
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-12-27 11:40:18 +01:00
Logan Rosen
2720ffa12a import-bug-from-debian: limit description to 50K chars
LP: #1193941
2020-12-26 01:49:43 -05:00
Mattia Rizzolo
bafe94c5c7
Merge branch 'for-upstream/depends-on-tzdata' of git+ssh://git.launchpad.net/~vicamo/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~vicamo/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/395578
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-12-22 17:54:05 +01:00
Mattia Rizzolo
6a9bcc6e14
Bump Standards-Version to 4.5.1, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-12-22 17:52:27 +01:00
Mattia Rizzolo
b00aea7aa5
init the next changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-12-22 17:51:54 +01:00
You-Sheng Yang
322df409c2 d/control: explicitly depends on tzdata
mk-sbuild would copy /etc/timezone and /etc/localtime from the host
environment, and it fails without them.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
2020-12-23 00:21:25 +08:00
Dan Streetman
b30df2b227 pullpkg: also catch InvalidPullValueError
LP: #1908770
2020-12-21 11:28:08 -05:00
Mattia Rizzolo
6c097233a9
Release 0.177
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-06-28 15:52:37 +02:00
Mattia Rizzolo
4b3e9b8479
syncpackge: Fix the new flake8 E741. Closes: #963310 2020-06-28 15:52:23 +02:00
Mattia Rizzolo
097eea7d5f
flak8-fy
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-06-26 20:47:05 +02:00
Mattia Rizzolo
622f550cc9
Merge branch 'update-maintainer-recursive' of git+ssh://git.launchpad.net/~bryce/ubuntu-dev-tools
MR: https://code.launchpad.net/~bryce/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/386415
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-06-26 20:45:32 +02:00
Bryce Harrington
8d77c72c33 update-maintainer: Consider only valid-looking debian directories
When scanning for debian/ directories to use, only consider ones that
have control and changelog files present.  This should handle cases
where the user may have non-package directories named debian high in
their path.
2020-06-26 10:57:46 -07:00
Bryce Harrington
928da0ec02 update-maintainer: Find debian/control from inside debian/
In addition to looking for ./debian in the current directory, scan up
the path in the case of running update-maintain from inside the debian/
directory.  This scans up to a maximum of 6 levels.

The --help text is adjusted to identify the detected path if one was
found, defaulting to './debian' otherwise.

LP: #1885233
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2020-06-25 18:19:30 -07:00
Mattia Rizzolo
f5aa75a3a5
Merge branch 'lintian-fixes' of git+ssh://git.launchpad.net/~debian-janitor/ubuntu-dev-tools
MR: https://code.launchpad.net/~debian-janitor/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/383535
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-05-09 17:34:56 +02:00
Debian Janitor
529c2870fc
Wrap long lines in changelog entries: 0.25, 0.11.
Fixes: lintian: debian-changelog-line-too-long
See-also: https://lintian.debian.org/tags/debian-changelog-line-too-long.html
2020-05-06 14:41:56 +00:00
Mattia Rizzolo
ce4d8fb85f
also update the docs
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-04-29 00:17:32 +02:00
Mattia Rizzolo
0aa7280f94
ubuntu-build: add support for riscv64.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-04-29 00:12:24 +02:00
Dan Streetman
5a895e9685 update changelog
pullpkg: support pulling from Ubuntu upload queues
2020-03-13 10:03:33 -04:00
Dan Streetman
8aa2d602c5 pullpkg: add support for pulling from upload queue 2020-03-13 10:02:05 -04:00
Dan Streetman
8f42fb976f lpapicache: add PackageUpload class 2020-03-13 10:02:05 -04:00
Dan Streetman
ea30b9f5bc ubuntutools/misc: add download() function
Move the download functionality from the archive.py into the common
misc.py file.
2020-03-13 10:02:05 -04:00
Dan Streetman
c622c30297 update changelog
Verify checksums for downloaded binary files
2020-03-13 09:59:28 -04:00
Dan Streetman
fe4d2f08a5 test: remove test_dsc_missing test
This test class performs 'local source package' tests, but a missing
local dsc file won't perform any local test, it will query the LP server.
The test attempted to narrowly mock out specific network access to
emulate a 'missing' package by trying to return 404 when the url from
SourcePackage._lp_url() is opened, but now that _lp_url() is removed,
a missing local dsc file will result in full querying of the LP api,
which is not as easily mocked.
2020-03-06 13:01:37 +01:00
Dan Streetman
11429b213c archive: remove _lp_url() 2020-03-06 13:01:37 +01:00
Dan Streetman
eaa07014e0 archive: verify and use existing already-downloaded files 2020-03-06 13:01:37 +01:00
Dan Streetman
8682c44957 archive: update pull_dsc to use _source_urls() and verify_file_checksum() 2020-03-06 13:01:37 +01:00
Dan Streetman
20dd65b281 archive: verify binary file checksums 2020-03-06 13:01:37 +01:00
Dan Streetman
45253b398c archive: remove unneeded 'found' flag
This var isn't needed - just using for/else is better
2020-03-06 13:01:37 +01:00
Dan Streetman
e1f2cbf831 archive: remove _binary_files_info()
also use spph/bpph provided urls
2020-03-06 13:01:37 +01:00
Dan Streetman
8ebd086aac ubuntutools/misc: add verify_file_checksum function 2020-03-06 13:01:37 +01:00
Dan Streetman
9f428e471b ubuntutools/misc: convert print() to std logging 2020-03-06 13:01:37 +01:00
Dan Streetman
907061c15e lpapicache: support 'include_meta' param in binaryFileUrls()
support the param for both native BPPH as well as Debian Snapshot
emulated BPPH

add sourceFileUrls() function

add helper functions to get file urls, checksums, and size
2020-03-06 13:01:37 +01:00
Dan Streetman
ee98423715 lpapicache: use urlparse instead of manual parsing 2020-03-06 13:01:37 +01:00
Dan Streetman
d98e16226b archive: change _download_file verify param to dscverify
The param is specific to dsc-verifiable files, so name it accordingly.
2020-03-06 12:18:10 +01:00
Dan Streetman
53fa2336b8 archive: cache Debian srcpkg when pulling binaries 2020-03-06 12:18:10 +01:00
Dan Streetman
f5694d7cf6 archive: pass src pkg file size to _download_file 2020-03-06 12:18:10 +01:00
Dan Streetman
7900a09763 archive: fix DebianSourcePackage implementation of _source_urls() 2020-03-06 12:18:10 +01:00
Mattia Rizzolo
f2b758f503
init changelog for next release
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-02-23 13:10:04 +01:00
Mattia Rizzolo
2decc105a2
Changelog for 0.176
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-02-23 13:09:19 +01:00
Mattia Rizzolo
41df9a33a4
d/control: Bump Standards-Version to 4.5.0, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-02-23 13:02:49 +01:00
Dan Streetman
36ffc92e00 pullpkg: for -p list, show bpph arch for files built for 'all' arch 2020-02-13 17:43:24 -05:00
Dan Streetman
3d7f542e49 archive: allow pull_binaries() to accept arch=None 2020-02-13 17:43:24 -05:00
Dan Streetman
ebe460aad1 lpapicache: allow getBinaries(arch=None) to get all archs
this was the previous behavior and some scripts still call with no args.

LP: #1862286
2020-02-13 17:43:22 -05:00
Dan Streetman
5553d98e47 lpapicache: remove fallback_arch from getBinaries
Even for 'all' arch binaries, there are separate BPPHs per arch,
so we should index them properly by actual arch.
2020-02-13 17:41:35 -05:00
Dan Streetman
5838fa39ff lpapicache: remove SPPH _have_all_binaries flag
The 'all' arch makes it possible to not actually have all the
BPPH records for all archs, depending on how we've been called
previously (i.e. with which archs and/or no archs).

It's safer to just maintain our cache and recheck it each time if needed.
2020-02-13 17:39:53 -05:00
Dan Streetman
63f614ebe3 archive: if using local file, avoid error trying to copy file to itself 2020-02-13 17:39:01 -05:00
Dan Streetman
f026b5d597 ubuntu-upload-permission: sort packagesets by name
The change from py2->py3 broke this script, as sorted now refuses to
perform sorting if the elements can't be directly compared.

LP: #1862372
2020-02-13 17:39:01 -05:00
Dan Streetman
fe30873247 submittodebian: open file in binary mode before writing utf-8 encoded bytes
LP: #1863119
2020-02-13 17:39:01 -05:00
Colin Watson
1e1702e676 Use +sourcefiles URLs where possible
In
https://code.launchpad.net/~cjwatson/launchpad/archive-unambiguous-files-traversals/+merge/345118,
I added support for downloading source package files from Launchpad that
can cope with the situation where different versions of a source package
have the same file name with different contents (normally impossible,
but it can happen with imported archives and due to some old bugs).  Use
this where possible.

LP: #1860456
2020-01-24 16:34:02 +00:00
Mattia Rizzolo
f8fa865ab2
pbuilder-dist: Add support for riscv64.
LP: #1859277
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2020-01-11 15:36:48 +01:00
Mattia Rizzolo
6e3d26185c
Merge branch 'lintian-fixes' of git+ssh://git.launchpad.net/~debian-janitor/ubuntu-dev-tools
MR: https://code.launchpad.net/~debian-janitor/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/376456
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-12-06 13:38:14 +01:00
Debian Janitor
c13988fbeb
Fix day-of-week for changelog entry 0.66.
Fixes lintian: debian-changelog-has-wrong-day-of-week
See https://lintian.debian.org/tags/debian-changelog-has-wrong-day-of-week.html for more details.
2019-12-06 12:19:47 +00:00
Mattia Rizzolo
7b95e4c457
Release 0.175
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-12-01 19:40:22 +01:00
Mattia Rizzolo
6e4ab93ff9
document ddstreet contributions in d/copyright
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-12-01 19:40:15 +01:00
Mattia Rizzolo
41345dd546
d/control: Bump Standards-Version to 4.4.1, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-12-01 19:35:49 +01:00
Mattia Rizzolo
87f226258a
Merge branch 'megamerge_request' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/375292
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-12-01 19:28:17 +01:00
Dan Streetman
82c8c438f7 ubuntutools: use file extension when possible to determine deb/ddeb/udeb 2019-11-25 16:40:18 -05:00
Dan Streetman
1a30454d1e test: remove test_archive obsolete tests
some tests mocked into the implementation of archive.py, which has now
changed dramatically, and the tests are no longer valid.
2019-11-25 10:10:06 -05:00
Dan Streetman
e37e9db7eb pullpkg: add --security param to query ubuntu sec team proposed ppa 2019-11-25 10:10:06 -05:00
Dan Streetman
87a09640ba ubuntutools/pullpkg.py: convert -v to count, enable package-wide debug for -vv 2019-11-25 10:10:06 -05:00
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Dan Streetman
c9c7fed1f6 pull-uca-*: search in reverse order of UCA releases, if none specified
if only the version of a UCA package is specified, search each UCA
archive from latest backwards.  This avoids having to specify both
the package version *and* UCA release.
2019-11-25 10:10:06 -05:00
Dan Streetman
7c097b19ba ubuntutools: add --status param to pull-pkg
Allow specifying what package statuses should be searched for.

By default search only for Pending and Published, unless a specific
version number is being searched for.
2019-11-25 10:10:06 -05:00
Dan Streetman
0f61836b10 ubuntutools: update archive/lpapicache to optionally search all series
For PPA and UCA repos, the latest build is not necessarily in the
'development' release; so for those SourcePackage classes, search
all the 'active' series (starting with latest devel) for any
matches to the provided package name.  This allows not having to
specify the series name when looking in PPA/UCA repos for the 'latest'
version of a specific package.
2019-11-25 10:10:06 -05:00
Dan Streetman
b11b83f0e2 pull-pkg: change UCA source pkg class to subclass of PPA source pkg class
The UCA source pkg class was its own specific class, but with the
addition of the generic PPA source pkg class, the UCA class is just
a specific case of PPA.  Changing it to a subclass of the PPA class
simplifies code.
2019-11-25 10:10:06 -05:00
Dan Streetman
7084bfc8bc pull-pkg: add pull-ppa-* functionality
Add functionality, and frontend pull-ppa-* scripts, to be able to pull
from PPA archives.
2019-11-25 10:10:06 -05:00
Dan Streetman
3491b0cff9 pull-pkg: change pullpkg into class PullPkg
instead of pullpkg.py containing a simple method to call, change it
into a normal class PullPkg that callers can create and use.
2019-11-25 10:10:06 -05:00
Dan Streetman
fb750e38bb lpapicache: find binaries from lp
Also update getBinaries() to allow retreival by binary name

This significantly speeds up binary file lookup for non-published
package versions, since we can get the list of binary urls, but
then have to look up the BPPH for each of those urls, which is slow.
If the user only wants a specific binary package and/or arch, this
speeds up getting that, especially for packages with a lot of binary
files (like the kernel).
2019-11-25 10:10:06 -05:00
Dan Streetman
3a413760f3 ubuntutools: add pull-* --no-verify-signature option, don't fail if no pub key
Change dsc verification to fail only if the public key was available, but
signature verification failed.  If no public key is available for the dsc,
print warning only. (LP: #1700846)

Also add pull-* parameter --no-verify-signature to manually prevent failure
when signature verification fails.
2019-11-25 10:10:06 -05:00
Dan Streetman
41a6c47ac2 pull-pkg: update man pages to all point to single pull-pkg.1 man page
remove the pull-lp-source.1 and pull-debian-source.1 man pages,
consolidating them both into a pull-pkg.1 man page.  Also create
symlinks for all associated scripts pointing to pull-pkg.1 man page.
2019-11-25 10:10:06 -05:00
Dan Streetman
e3268a62f4 pull-pkg: create pull-[lp|debian|uca]-* scripts
for backwards compatibility (i.e. to keep pull-lp-source,
pull-debian-source, and pull-uca-source) and for ease of use,
create scripts that default the pull-pkg -p and -D params

re-create pull-pkg script also, to call ubuntutools/pullpkg.py
without any default pull or distro parameters
2019-11-25 10:10:06 -05:00
Dan Streetman
cdaf5d0761 pull-pkg: change pull-pkg script code into modular code 2019-11-25 10:10:06 -05:00
Dan Streetman
79b705d235 pull-pkg: rename pull-pkg to ubuntutools/pullpkg.py module
rename only with no content changes, so next commit shows code
changes converting script pull-pkg to module pullpkg.py

This also changes the file mode from 755 to 644, since we're changing
an executable script into a module.
2019-11-25 10:09:26 -05:00
Dan Streetman
d7bcb012f6 pull-pkg: update to use previous SourcePackage improvements
New pull-pkg allows pulling source, debs, ddebs, or udebs, or just
listing all package files. Also, package lookup by binary name is done
automatically.
2019-11-25 09:57:54 -05:00
Dan Streetman
ec72cf1538 pull-pkg: rename pull-lp-source to pull-pkg
no changes to the file, just a rename, to allow the next commit
to show the changes to the file.
2019-11-25 09:57:54 -05:00
Dan Streetman
3dabf05370 pull-pkg: add debian and ubuntu ddebs mirror urls 2019-11-25 09:57:54 -05:00
Dan Streetman
f4f16f95f7 pull-uca: update UbuntuCloudArchiveSourcePackage
look in its PPA for its SPPHs
look up the development (latest) UCA release if not specified
use the 'series' param as the UCA release, instead of 'uca_release' param
2019-11-25 09:57:54 -05:00
Dan Streetman
b96885f05e ubuntutools/archive: convert external rmadison call to native implementation
instead of a function that calls the system program rmadison, use
a fully-functional class to interface with the madison api, as well
as the debian snapshot api
2019-11-25 09:57:54 -05:00
Dan Streetman
f944d3146a pull-pkg: find src pkg name from binary pkg name 2019-11-25 09:57:54 -05:00
Dan Streetman
9f58f5cb80 pull-pkg: find latest pkg in series in SourcePackage
Allow specifying series instead of version, to find the latest
version in that series; or only specify package name, to get the
latest version in the devel series
2019-11-25 09:57:54 -05:00
Dan Streetman
b0c22e1d57 pull-pkg: update archive.py SourcePackage
verify it can parse/load DSC when created
throw PackageNotFoundException from lp_spph if can't find package
update test case expected order of url processing
2019-11-25 09:57:54 -05:00
Dan Streetman
506e3db601 pull-pkg: add SourcePackage.pull_binaries() function 2019-11-25 09:57:54 -05:00
Dan Streetman
d3b8d7a1b7 ubuntutools/lp/lpapicache: expand coverage for LP api 2019-11-25 09:57:54 -05:00
Dan Streetman
51231f116c debian/control: add python3-lazr.restfulclient dep to python3-ubuntutools 2019-11-25 09:57:54 -05:00
Dan Streetman
d0aa64a51b ubuntutools/misc: define POCKETS and DEFAULT_POCKETS
POCKETS is all valid pockets (capitalized), DEFAULT_POCKETS is all in
POCKETS except 'Backports'.
2019-11-25 09:57:54 -05:00
Dan Streetman
b5ae0bdca3 simplify subprocess usage 2019-11-25 09:57:54 -05:00
Mattia Rizzolo
463d1f63a8
requestbackport: Error out nicely when a tracking project doens't exist.
LP: #1852901
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-11-21 16:20:02 +01:00
Mattia Rizzolo
c7b2149e1a
Merge branch 'py3debian-changelog' of git+ssh://git.launchpad.net/ubuntu-dev-tools
MR: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372620
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-11-11 14:44:04 +01:00
Mattia Rizzolo
8220accbe8
Merge branch 'submittodebian_context_mgr' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/375291
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-11-11 14:27:20 +01:00
Mattia Rizzolo
d3d63d6a59
Merge branch 'pylint_jobs' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/375289
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-11-11 14:25:46 +01:00
Dan Streetman
17cce2602c submittodebian: use file context manager 2019-11-07 15:10:16 -05:00
Dan Streetman
0931098a2c tests/pylint.conf: use jobs=0 to speed up tests 2019-11-07 15:03:29 -05:00
Mattia Rizzolo
982ebe6a46
Trust the installed debian-keyring when checking validity of dsc signatures. 2019-10-28 14:35:01 +01:00
Mattia Rizzolo
ba2afc6429
Release 0.174
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-26 11:07:46 +02:00
Mattia Rizzolo
21adb8f61f
fix flake8 warning
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-26 11:05:48 +02:00
Mattia Rizzolo
e083529784
import-bug-from-debian: revert a change from the last merge: keep debianbts an optional dependency
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-26 10:56:48 +02:00
Mattia Rizzolo
9cd3479218
Merge branch 'import-bug-from-debian' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372643
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-26 10:53:54 +02:00
Mattia Rizzolo
b76201967a
Merge branch 'reverse-depends-fixes' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372653
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-12 14:40:40 +02:00
Mattia Rizzolo
dc6e03d38c
Merge branch 'python3_missed_one' of git+ssh://git.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools
MR: https://code.launchpad.net/~ddstreet/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372644
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-12 14:37:26 +02:00
Mattia Rizzolo
c8602ba8a2
Merge branch 'ubuntutools-misc' of git+ssh://git.launchpad.net/ubuntu-dev-tools
MR: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372627
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-12 14:34:30 +02:00
Dan Streetman
ec14165262 reverse-depends fixes
move from optparse to argparse

fix typo in --recursive-deph param

use list comprehensions to fix/simplify del-during-iteration functions
2019-09-11 18:11:20 -04:00
Dan Streetman
2c998a6fd2 setup.py: convert to py3 2019-09-11 17:18:51 -04:00
Dan Streetman
0d9d78a721 import-bug-from-debian fixes
change PEP263 coding value from invalid UTF-8 to valid utf-8

don't try to import debianbts, just import debianbts

migrate to argparge

add --verbose option

actually make --dry-run do a dry run

handle multiple cmdline bug numbers

correctly get the bug summary
2019-09-11 17:02:14 -04:00
Stefano Rivera
e5c90b986c reverse-depends: Support Reverse-Testsuite-Triggers and Reverse-Build-Depends-Arch (LP: #1843614) 2019-09-11 16:03:13 -03:00
Stefano Rivera
317b68bc08 Use a context manager for opening files 2019-09-11 13:38:42 -03:00
Stefano Rivera
7a6b779e77 ubuntutools.misc: Replace Popen() calls with check_output() 2019-09-11 13:38:42 -03:00
Stefano Rivera
454737b5bf Rewrite merge-changelog using python3-debian 2019-09-11 12:14:08 -03:00
Mattia Rizzolo
4438c23a72
Changelog for 0.173
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 15:35:19 +02:00
Mattia Rizzolo
228c5710e7
Explicitly require Python3 >= 3.6.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:27:42 +02:00
Mattia Rizzolo
2c4fcfc0b9
De-duplicate Depends field
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:25:55 +02:00
Mattia Rizzolo
68b41fc82f
Drop workaround for an old pylint bug
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:25:35 +02:00
Mattia Rizzolo
434ca8952e
Merge branch 'python3' of git+ssh://git.launchpad.net/ubuntu-dev-tools
MR: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372305
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:19:07 +02:00
Mattia Rizzolo
19ba351f57
update changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 10:57:57 +02:00
Dan Streetman
72a3420944 make ubuntu-dev-tools require matching version of python-ubuntutools
without specific version matching, a simple 'apt install ubuntu-dev-tools'
on a system with an older version of ubuntu-dev-tools and deps will leave
the older python-ubuntutools installed, which may not work with the updated
ubuntu-dev-tools code.
2019-09-09 14:55:16 -04:00
Dan Streetman
a7d166b52f pull-pkg: use ubuntutools/version/Version
instead of debian.debian_support.Version, use ubuntutools version,
which extends it and adds the strip_epoch() function which is
needed to convert full version string to version used in filenames
2019-09-09 12:25:21 -04:00
Stefano Rivera
06642ef9f7 Remove some more u'' strings 2019-09-05 16:10:26 -03:00
Stefano Rivera
38632a190e We depend on python3-debian 2019-09-05 09:50:09 -03:00
Stefano Rivera
7b2f1a713b Remove more Python 2 fallback imports 2019-09-05 09:49:41 -03:00
Stefano Rivera
8bdf4f839a requestbackport: In python3, Entry isn't hashable 2019-09-04 19:32:59 -03:00
Stefano Rivera
301569e809 Pull out Python 2 support hacks 2019-09-04 19:24:44 -03:00
Stefano Rivera
bb765237db Port Python scripts to Python 3, remove python 2 modules. (Closes: #938740, LP: #1099537) 2019-09-04 19:24:44 -03:00
Stefano Rivera
3d345113cc Use python3-debian's Version class in merge-changelog, to support Python 3. 2019-09-04 19:24:44 -03:00
Stefano Rivera
66afe7c6fc Port import-bug-from-debian to Python 3
Use python3-debianbts for BTS wrangling, rather than SOAPPy, which
wasn't ported to Python 3.
2019-09-04 19:24:44 -03:00
Stefano Rivera
d681c7dc89 Unused exception variables 2019-09-04 19:24:44 -03:00
Stefano Rivera
5f3247cfc0 Port update-maintainer to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
96896fd2c8 Port ubuntu-upload-permission to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
16b9311995 Port ubuntu-iso 2019-09-04 19:24:44 -03:00
Stefano Rivera
6c375255c4 Port ubuntu-build to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
2c8c4d7268 Port syncpackage to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
3f5e56c75e Port submittodebian to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
76609fde49 Port sponsor-patch to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
673234e449 Port seeded-in-ubuntu to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
31d1ae269a Port reverse-depends to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
b311cebaed More requestsync porting and cleanup 2019-09-04 19:24:44 -03:00
Scott Kitterman
81b17cd323 Update requestsync to python3 (Closes: #927147) 2019-09-04 19:24:44 -03:00
Stefano Rivera
7c0efe2914 Port requestbackport to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
0de4509da6 Port pull-uca-source to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
4239d49582 Port pull-lp-source to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
6a60ee963d Port pull-debian-debdiff to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
d1949a72aa Port pbuilder-dist to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
118f95b62e Port hugadaylist to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
3052bfcc16 Port grep-merges to python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
05ce00a49a Port enforced-editing-wrapper to python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
071ff40f20 Port check-mir to Python 3 2019-09-04 19:24:44 -03:00
Stefano Rivera
2a0bffc2a0 Port bitesize to python3 2019-09-04 19:24:44 -03:00
Stefano Rivera
a41af75643 Close FDs after tests 2019-09-04 19:24:44 -03:00
Stefano Rivera
7f9949fc4c Port backportpackage to Python 3. 2019-09-04 19:24:44 -03:00
Stefano Rivera
23c7d67425 Replace simple Popen() calls with check_output() 2019-09-04 19:24:44 -03:00
Stefano Rivera
2d3765522e Use the Popen() encoding flag to decode to unicode
This should make behavior identical on Python 2 & 3.
2019-09-04 19:24:44 -03:00
Stefano Rivera
43ad610a66 Add encoding support to our Popen wrapper 2019-09-04 19:24:44 -03:00
Stefano Rivera
9ef7545150 Move non-Python scripts to the python3 section 2019-09-04 19:24:44 -03:00
Stefano Rivera
7c5f2431db Drop 404main, it's been totally broken for years. 2019-09-04 19:24:44 -03:00
Stefano Rivera
2138919700 pull-debian-debdiff: Don't unpack the older source package, it will often use the same directory as the newer one, and break. 2019-09-04 16:31:37 -03:00
Mattia Rizzolo
366ff25690
Release 0.172
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-04 08:52:02 +02:00
Stefano Rivera
5769a70d02 Increase --help timeout, seeing a few of them 2019-09-03 21:16:59 -03:00
Stefano Rivera
03d2e89f31 Use dh_install to split the build into multiple binary packages. 2019-09-03 21:16:57 -03:00
Stefano Rivera
7fd1a6a766 Install pull-debian-source as python 3. It was ported, and doesn't work under python 2 any more. (LP: #1841127) 2019-09-03 21:16:43 -03:00
Stefano Rivera
caaea17eec dh_python2 doesn't generate a python dependency in ubuntu-dev-tools, now that it's scripts-only, so manually declare one. 2019-09-03 21:16:11 -03:00
Stefano Rivera
8ab21ea485 Explicitly declare python dependencies in the python library modules (the setup.py doesn't provide these) and ubuntu-dev-tools itself. 2019-09-03 21:15:21 -03:00
Stefano Rivera
e163ee0158 Test with the pylint command, we don't have py2+3 versions any more 2019-09-03 21:10:38 -03:00
Stefano Rivera
b0421706d5 Build-Depend on pylint (>= 2, the Python 3 version), it replaced pylint3. 2019-09-03 21:10:38 -03:00
Stefano Rivera
af622cb71e wrap-and-sort -ats 2019-09-03 21:10:30 -03:00
Mattia Rizzolo
ae04bcfc43
autopkgtest: Add a allow-stderr restriction, as things log to stderr.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-23 10:08:13 +02:00
Mattia Rizzolo
dc3d2c0c2d
changelog for 0.171
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-12 13:56:09 +02:00
Mattia Rizzolo
6c47c075aa
d/clean: delete the whole egg-info directory, not just the contents
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-12 13:55:39 +02:00
Mattia Rizzolo
e0f6b6f97b
archive: Disable dsc signature verification for non-Debian.
Ubuntu doesn't have a unified keyring of developers like Debian has, so
it is not feasible to check for the dsc signatures.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-12 13:41:16 +02:00
Mattia Rizzolo
ad6d560a15
Add an autopkgtest running the package tests
Currently it runs the tests directly over the sources, instead of the installed package.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-12 13:41:08 +02:00
Mattia Rizzolo
c744f7441f
Changelog for 0.170
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-05 13:50:40 +02:00
Mattia Rizzolo
3fb7516d72
Default to checking signatures while pulling a .dsc.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-05 13:50:33 +02:00
Mattia Rizzolo
257b0a8d67
reverse-depends: prevent crash when specifying a specific architecture.
Closes: #933018
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-05 13:28:59 +02:00
Mattia Rizzolo
1007bc87e8
Close lp bug in the previous merge
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 15:12:31 +02:00
Mattia Rizzolo
cf91180e9a
d/control: Bump debhelper compat level to 12.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 15:11:10 +02:00
Mattia Rizzolo
3f87486de3
Merge branch 'pull-debian-source-edge-cases' of git+ssh://git.launchpad.net/~racb/ubuntu-dev-tools
MR: https://code.launchpad.net/~racb/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/326608
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 15:10:35 +02:00
Mattia Rizzolo
07f2c179c2
Release 0.169
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 11:18:06 +02:00
Mattia Rizzolo
6c404a3557
fix new flake8 issues
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 11:17:54 +02:00
Mattia Rizzolo
db13c754a5
d/control: Bump Standards-Version to 4.4.0, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 10:59:13 +02:00
Mattia Rizzolo
9858a03a12
d/control: add myself to uploaders
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 10:58:07 +02:00
Mattia Rizzolo
4a4ed663e0
Document previous change
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 10:57:25 +02:00
Mattia Rizzolo
dbbd7fcca0
Merge branch 'master' of git+ssh://git.launchpad.net/~sahid-ferdjaoui/ubuntu-dev-tools
MR: https://code.launchpad.net/~sahid-ferdjaoui/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/369727
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-07-20 10:55:24 +02:00
Sahid Orentino Ferdjaoui
5cf0f000db introduce ability to find reverse dependencies recursively
The change is introducing two options: --recursive and
--recursive-depth. So user will be able to print the full chain of
reverse-deps.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-07-04 19:18:28 +02:00
Colin Watson
ae9c80de37 mk-sbuild: Set personality=linux32 on armel/armhf 2019-06-04 11:07:10 +01:00
Steve Langasek
f9c4aeaae1 releasing package ubuntu-dev-tools version 0.168 2019-05-07 21:32:04 -07:00
Steve Langasek
7143367610 grep-merges: flake8-clean.
Signed-off-by: Steve Langasek <steve.langasek@ubuntu.com>
2019-05-07 21:32:04 -07:00
Steve Langasek
eb84867721 releasing package ubuntu-dev-tools version 0.167 2019-05-07 18:54:24 -07:00
Steve Langasek
fec29f22bc grep-merges: support grepping by team name (full name match)
Signed-off-by: Steve Langasek <steve.langasek@ubuntu.com>
2019-05-07 18:24:07 -07:00
Colin Watson
3bef7f999b Previous commit closes LP: #1807992 2018-12-11 16:50:13 +00:00
Colin Watson
fb22ba116f syncpackage: Support wildcards in sync-blacklist
This brings syncpackage's parsing of sync-blacklist.txt roughly into
line with that in auto-sync (from lp:ubuntu-archive-tools).
2018-12-11 16:39:51 +00:00
Mattia Rizzolo
6b8a75bc99
Changelog for 0.166
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 22:22:29 +02:00
Mattia Rizzolo
dc5e586b99
mk-sbuild: disable recommends also within the chroot
LP: #1268684
Thanks: Steve Beattie for the patch.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 22:06:10 +02:00
Mattia Rizzolo
c41f57686b
update changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:59:35 +02:00
Mattia Rizzolo
c12595fa61
retro-actively close old bug in an old changelog.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:59:14 +02:00
Mattia Rizzolo
7d0205011a
Add a recommends on ubuntu-keyring | ubuntu-archive-keyring.
Closes: #838254
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:55:34 +02:00
Mattia Rizzolo
14a3dd5634
Clarify package descriptions for Python libraries.
Closes: #804198, #804199
Thanks: Ben Finney for the patch.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:54:48 +02:00
Mattia Rizzolo
5b6445c1d0
Use the new debhelper-compat(=11) notation and drop d/compat.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:40:40 +02:00
Mattia Rizzolo
2a620e9aa2
Bump Standards-Version to 4.2.1, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:40:25 +02:00
Mattia Rizzolo
bc0c276364
new wrap-and-sort -ast
Gbp-Dch: Ignore.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:39:52 +02:00
Mattia Rizzolo
1481ed8438
Add missing build-depends for tests, cominf from the new tool
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:39:06 +02:00
Mattia Rizzolo
ff184c6780
Add missing dependencies on sensible-utils (thanks lintian!).
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:37:47 +02:00
Mattia Rizzolo
0886e02435
update changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-10-23 21:37:22 +02:00
Benjamin Drung
190ad30a7b Fix invalid escape sequence '\(' or '\)' (found by flake8)
flake8 found issues:
ubuntutools/sponsor_patch/bugtask.py:46:11: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:50: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:58: W605 invalid escape sequence '\)'
setup.py:14:8: W605 invalid escape sequence '\('
setup.py:14:14: W605 invalid escape sequence '\)'

Fix these issues by marking these strings as raw strings.
2018-10-06 18:04:25 +02:00
Benjamin Drung
74df5b3869 Update pylint and flake8 unittests
Import improvements from https://github.com/bdrung/snippets
2018-10-06 17:42:59 +02:00
Benjamin Drung
468dbc7746 ubuntutools/test: Introduce get_source_files function
The flake8 and pylint unittest use the same logic to determine the source
files. Therefore put this logic in one function.
2018-10-06 17:16:12 +02:00
Mathieu Trudel-Lapierre
5ebd1eaa8d Add 'ubuntu-archive-assistant' tool for proposed-migration / mir review 2018-09-20 09:05:01 +02:00
Mattia Rizzolo
c5bc971f17
Merge branch 'breezy' of https://git.launchpad.net/~jelmer/ubuntu-dev-tools
MR: https://code.launchpad.net/~jelmer/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/353759
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-09-03 16:11:43 +02:00
Jelmer Vernooij
e763606da0
Recommend Bazaar (brz) or Breezy (brz); the latter provides a command-line compatible interface. 2018-08-26 19:07:04 +01:00
Mattia Rizzolo
a2aacb28ff
Merge branch 'lp1314076' of git+ssh://git.launchpad.net/~freyes/ubuntu-dev-tools
MR: https://code.launchpad.net/~freyes/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/345774
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-18 17:58:34 +02:00
Mattia Rizzolo
0ebcc329a3
Init changelog
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-18 17:57:30 +02:00
Felipe Reyes
105db5752b pbuilder-dist: pass one --othermirror when local archive found (LP: #1314076) 2018-05-18 11:47:35 -04:00
Mattia Rizzolo
bdc647404f
Changelog for 0.165
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-10 10:41:11 +02:00
Mattia Rizzolo
87e2e1b7aa
drop id-length from gbp.conf, we are not consistently using it anyway
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-10 10:40:44 +02:00
Mattia Rizzolo
607f5a712f
Fix FTBFS due to newest tar being picker about arguments order
Closes: #897478
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-10 10:38:25 +02:00
Mattia Rizzolo
10299855a5
Bump debhelper compat level to 11.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-05-10 10:38:13 +02:00
Adam Conrad
06fc171980 mk-sbuild: Initialise ubuntu_dist_ge vars so unknown releases work. 2018-04-24 05:28:44 -06:00
Adam Conrad
92822060b2 mk-sbuild: Add ubuntu_dist_ge and use it to set BUILD_PKGS for Ubuntu. 2018-04-24 05:12:33 -06:00
Mattia Rizzolo
1f7b7ea4ff
Changelog for 0.162
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-04-05 19:08:10 +02:00
Mattia Rizzolo
eb844a2193
Change Maintainer address to ubuntu-dev-tools@packages.debian.org, to assist with the alioth deprecation
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-04-05 19:08:10 +02:00
Mattia Rizzolo
c40050f496
Add a dependency on sensible-utils, as we use sensible-editor(1).
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-04-05 18:58:11 +02:00
Mattia Rizzolo
ddbd7f73c3
mk-sbuild: fix syntax error caused by 96d698e4290b
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-04-05 18:53:29 +02:00
Mattia Rizzolo
fc0919ed25
mk-sbuild: indent
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-04-05 18:51:50 +02:00
Mattia Rizzolo
1ea9bce9b1
Set Rules-Requires-Root:no. 2018-04-05 18:51:27 +02:00
Mattia Rizzolo
01906f8371
Drop superseded X-Python(3)-Version fields. 2018-04-05 18:47:14 +02:00
Mattia Rizzolo
e88b4905bf
Bump Standards-Version to 4.1.4, no changes needed. 2018-04-05 18:45:43 +02:00
Scott Kitterman
afd95915e4 Add --backports option to pbuilder-dist to make it easier to build for backports when dependencies from backports are needed 2018-03-24 14:30:19 -04:00
Dimitri John Ledkov
96d698e429 Add support for 'overlay' in favor of older 'overlayfs'. 2018-03-23 02:55:01 +00:00
Mattia Rizzolo
edb49c652c
Fix test failures with newer flake8 and pylint.
Closes: #891721
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-03-08 12:56:36 +01:00
Mattia Rizzolo
157411a199
Release 0.161 to unstable.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-07-18 07:43:48 +02:00
Mattia Rizzolo
224b059e30
Bump Standards-Version to 4.0.0, no changes needed.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-07-18 07:43:37 +02:00
Robie Basak
0291ad07b0 pull-debian-source: convert to Python 3
This has the (desired) side effect of fixing the guessing of the correct
encoding in dsc files when not UTF-8. Presumably this is because Python
3 has some improvements in that area. Since it's what we want, I see no
need to dig further.

LP: #1700846
2017-06-30 15:47:29 +01:00
Robie Basak
a761ccfc72 Fix rmadison parsing for Python 3
In Python 3, it matters that the output of rmadison must be decoded
before it can be parsed.
2017-06-30 15:47:29 +01:00
Robie Basak
4c66fba4d9 pull-debian-source: --no-verify-signature option
Using pull-debian-source fails on some very old packages such as on
texinfo 4.8.dfsg.1-4. I have hand-verified that the signature is good
(though with no trust path), so presumably this is because the signature
has rotated out of debian-keyring.

Add a --no-verify-signature option so that developers can still make use
of the find-and-download functionality of this tool, albeit without
signture verification.
2017-06-30 15:47:29 +01:00
Iain Lane
15841a3df6 Update & finalise changelog 2017-06-13 10:14:17 +01:00
Iain Lane
798a36c2d8 subprocess: Use getfullargspec on python3 2017-06-13 10:13:25 +01:00
Iain Lane
59582ca06e Releasing 0.159 2017-05-30 11:34:28 +01:00
Iain Lane
0a3738cfbc Fix some 2/3 differences and run pylint with confidence=HIGH
Too many false positives otherwise.
2017-05-30 11:22:49 +01:00
Iain Lane
d41602ba83 debian/README.source: Add with some instructions about changelog 2017-05-30 10:32:28 +01:00
Iain Lane
44dc0a9d88 debian/gbp.conf: Add gbp-dch configuration 2017-05-30 10:32:07 +01:00
Iain Lane
179f45ca9c Add some more ignores for pylint
It doesn't work very well with apt_pkg.
2017-05-30 10:27:22 +01:00
Iain Lane
4471193d9c ubuntu-build: Pass the pocket through to the archive permission check
So that we can retry builds in releases where the release pocket is frozen -
for example so that backporters can retry backports builds.
2017-05-30 10:12:56 +01:00
Mattia Rizzolo
001d108b96
Recommend cowbuilder, not cowdancer
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-05-02 10:51:27 +02:00
Benjamin Drung
18ae4d8a39 Add flake8 check to test suite 2017-05-01 00:20:17 +02:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Benjamin Drung
3a6cd3ac66 Fix pylint3 error (for Python 2 support code) 2017-04-30 23:49:18 +02:00
Benjamin Drung
67c353d91b Raise maximum line length to 99 2017-04-30 22:31:09 +02:00
Benjamin Drung
ba16daf56f Repair pylint test case
The --include-ids parameter was dropped from pylint and thus the command
failed as was skipped. Repair the pylint check and add support for
Python 3.
2017-04-30 22:29:41 +02:00
Benjamin Drung
6ee0915d3f Add .gitignore 2017-04-30 22:28:56 +02:00
Anatoly Techtonik
bf52bd6fa3 backportpackage: improve python3 compatibility
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-04-30 20:03:07 +02:00
Ursula Junque (Ursinha)
6fea8fb542 Fix behavior of getBinaryPackage in lpapicache
It was using the same parameters to get Source and Binary packages build
history, but source packages need a distro series, and binary packages
need distro arch series, as the results are arch dependent.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-04-30 20:02:06 +02:00
Unit 193
f67601cb0c mk-sbuild, pull-debian-{debdiff,source}: Switch from httpredir.debian.org to deb.debian.org as the default mirror for Debian
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-04-30 18:44:04 +02:00
Iain Lane
a6043a6ba8 Remove the `harvest' command, and all other integration with the Harvest service, since it has been shut down. 2017-04-03 13:58:02 +02:00
Mattia Rizzolo
88fbffaf49 Bump debhelper compat level to 10.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-03-30 21:14:28 +02:00
Mattia Rizzolo
3c138f6fe3 Bump Standards-Version to 3.9.8, no changes needed
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-03-30 21:13:29 +02:00
Mattia Rizzolo
1c6b989590 Move packaging to git
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-03-30 21:13:04 +02:00
Mattia Rizzolo
e55c306a90 Init changelog for 0.159
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-03-30 21:12:16 +02:00
Mattia Rizzolo
572f0f0156 retroactively add bug number to changelog 2017-03-30 05:30:28 +02:00
Mattia Rizzolo
e0c6689cb8 Release 0.158 to Debian experimental 2017-03-29 20:08:33 +02:00
Dmitry Shachnev
ab1e334e3e Close bug #1663601 from the changelog 2017-02-16 13:00:33 +03:00
Dan Streetman
15a9f0e328 pull-uca-source: Update to allow using binary pkg names, -pockets, and specific versions. 2017-02-03 10:49:26 -05:00
Dan Streetman
03fda64eae pull-uca-source: update to allow using binary pkg names, -pockets, and specific versions 2017-02-03 10:21:37 -05:00
Corey Bryant
86b2c25c16 pull-uca-source: Ensure package and openstack release are specified. 2016-10-17 11:10:29 -04:00
Corey Bryant
d67090f752 pull-uca-source: Added to pull source from Ubuntu Cloud Archive. 2016-10-17 09:58:17 -04:00
James Page
e56c0fce43 grep-merges: Use unicode string format for pretty output to deal with
non ascii encoding.
2016-08-04 17:15:13 +01:00
Colin Watson
f232d121d2 pbuilder-dist, ubuntu-build: Add s390x. 2016-07-16 10:55:28 +01:00
Martin Pitt
4d07f85874 grep-merges: Do not override author or uploader with None
There can be JSON entries which have uploader=None.
2016-05-13 09:04:55 +02:00
Adam Conrad
0575dd0112 mk-sbuild: cp localtime and timezone a little harder (LP: #1569400) 2016-05-09 00:00:40 -06:00
Adam Conrad
53dc45e6e3 Release to unstable 2016-05-08 23:29:01 -06:00
Luke Faraone
a595624527 mk-sbuild: Add --skip-security, like --skip-updates (LP: #1366721) 2016-05-08 23:26:53 -06:00
Adam Conrad
139346addf Add bug reference for last commit 2016-05-08 23:25:08 -06:00
Luke Faraone
bae9b3817d mk-sbuild: Add a --debootstrap-opts argument for arbitrary options. 2016-05-08 23:18:28 -06:00
Adam Conrad
e903bf03d1 mk-sbuild: Remove references to the obsolete arm architecture, and
allow armhf and armel to be native on arm64 systems (LP: #1579619)
2016-05-08 23:09:55 -06:00
Dmitry Shachnev
3a425de23e grep-merges: Do not override author or uploader with None
There can be JSON entries which have uploader=None, and such entries would
lead to TypeError when trying to use ' '.join().
2016-04-27 13:05:54 +03:00
Benjamin Drung
6fa16dd85e releasing package ubuntu-dev-tools version 0.155 2015-10-30 23:04:07 +01:00
Benjamin Drung
d140d6423b Run wrap-and-sort 2015-10-30 22:59:24 +01:00
Benjamin Drung
311f3d9a23 Drop recommending perl-modules. perl-base is enough for dch-repeat and pull-revu-source 2015-10-30 22:58:51 +01:00
Benjamin Drung
a753fedf7b Install bash completions into /usr/share/bash-completion/completions 2015-10-30 22:56:49 +01:00
Benjamin Drung
de109e65c4 Bump Standards-Version to 3.9.6 (no changes needed) 2015-10-30 22:26:36 +01:00
Benjamin Drung
f7c0e64843 Use https URL to copyright format specification 2015-10-30 22:17:37 +01:00
Benjamin Drung
cb0e15a1e6 Move python*-ubuntutools to section Python 2015-10-30 22:15:38 +01:00
Daniel Holbach
0ef87a90fe merged lp:~smoser/ubuntu-dev-tools/lp1508948-rmadison-sid-is-unstable 2015-10-26 08:57:45 +01:00
Scott Moser
12c86a8fda ubuntutools/archive.py/rmadison: return results for sid if asked about unstable
Some versions of rmadison return results with 'unstable' when asked about sid.
Others return 'sid'.  This makes a query of 'unstable' return results
for sid.

End result is fixing 'pull-debian-source hello' on wily.
2015-10-22 10:00:21 -04:00
Daniel Holbach
a860b7cbaf merged lp:~mtmiller/ubuntu-dev-tools/debian-httpredir 2015-08-31 09:51:34 +02:00
Mike Miller
8ac2c33059 mk-sbuild, pull-debian-{debdiff,source}: Use httpredir.debian.org as the
default mirror for Debian.
2015-08-22 11:51:04 -04:00
Adam Conrad
91c5ff3bbf Add changelog entry for the last change 2015-06-14 13:51:38 -06:00
Adam Conrad
f0d22226a9 Allow requestsync/syncpackage to work with either codename or alias 2015-06-14 13:50:28 -06:00
Benjamin Drung
c4e998e165 Remove trailing spaces 2015-01-24 22:29:20 +01:00
Benjamin Drung
30a6d4e304 Fix typos 2015-01-24 22:28:49 +01:00
Dimitri John Ledkov
ba4e195cde Add python-ubunutools dependency to ubuntu-dev-tools. 2015-01-20 14:18:35 +00:00
Dimitri John Ledkov
99eb51b4e1 Fix test_config to skip Unicode environment variable test, when python
interpreter is not running in an unicode capable locale.
2015-01-19 15:21:00 +00:00
Dimitri John Ledkov
9d09768bd1 Fix python3 setup.py clean failing to read unicode from
debian/changelog.
2015-01-19 14:08:51 +00:00
Dimitri John Ledkov
dbeddb5559 releasing package ubuntu-dev-tools version 0.154 2014-12-23 17:04:01 +00:00
Dimitri John Ledkov
221867ca37 Add misc depends. 2014-12-23 16:15:40 +00:00
Dimitri John Ledkov
24d9ce3e7c mk-sbuild: support debootstrap keyring and no-check-gpg
options. (Closes: 754327)
2014-12-23 16:14:21 +00:00
Dimitri John Ledkov
427ac0d620 Port ubuntutools module to python3. 2014-12-23 16:12:18 +00:00
Dimitri John Ledkov
149182a3cd Mock mock more. 2014-12-19 22:54:18 +00:00
Dimitri John Ledkov
124e421b61 There is no python3-soappy yet. 2014-12-19 22:42:46 +00:00
Dimitri John Ledkov
646093d74a Port ubuntutools module to python3. 2014-12-19 22:37:04 +00:00
Dimitri John Ledkov
e162e7d580 Port ubuntutools library 2014-12-18 23:51:59 +00:00
Dimitri John Ledkov
8ae64c16e2 Disable test_dsc_badsig, when no networking is available. 2014-12-18 23:35:00 +00:00
Dimitri John Ledkov
866adfd768 Actually, now that more things expect streaming bytes over the wire
the mirror tests don't stall anymore. Also use a codec.reader to slurp
up unicode bytes for json.load.
2014-12-18 23:18:00 +00:00
Dimitri John Ledkov
5da114b070 More consistent binary handling throughout.
Don't mock open(..., "b") with str / StringIO.
Silence source package pull, buffered/mocked output does not flush.
Disable mirror tests on python3, stall/hang.
2014-12-18 23:03:23 +00:00
Dimitri John Ledkov
ed0cd2c1b5 file is gone in python3 2014-12-18 22:05:55 +00:00
Dimitri John Ledkov
412afabc1c Fix maintainer 2014-12-18 21:54:52 +00:00
Dimitri John Ledkov
1bab644191 Conf fixes 2014-12-18 21:53:00 +00:00
Dimitri John Ledkov
ddabeed530 Fix ups 2014-12-18 21:34:13 +00:00
Dimitri John Ledkov
d86cacddf9 finish no-regress pre-port. 2014-12-18 21:18:01 +00:00
Dimitri John Ledkov
b8cf7b113e logger 2014-12-18 21:11:00 +00:00
Dimitri John Ledkov
dae4c18c9e update_maintainer 2014-12-18 21:09:44 +00:00
Dimitri John Ledkov
a7f4fc202b fix test_config 2014-12-18 21:06:44 +00:00
Dimitri John Ledkov
8b5db046be t/t_config 2014-12-18 21:03:27 +00:00
Dimitri John Ledkov
509b612b0f fix sp/sp 2014-12-18 21:03:05 +00:00
Dimitri John Ledkov
e959384f02 update_maintainer 2014-12-18 20:57:17 +00:00
Dimitri John Ledkov
8c6371a416 sp/sp 2014-12-18 20:56:13 +00:00
Dimitri John Ledkov
c8ec463f7a sp/source_package 2014-12-18 20:54:00 +00:00
Dimitri John Ledkov
57ea2cc410 question 2014-12-18 20:52:51 +00:00
Dimitri John Ledkov
194d23e878 patch 2014-12-18 20:52:17 +00:00
Dimitri John Ledkov
e20d125709 bugtask 2014-12-18 20:51:24 +00:00
Dimitri John Ledkov
3f512ee337 rs/mail 2014-12-18 20:48:28 +00:00
Dimitri John Ledkov
1d2f7f6d0d rs/lp 2014-12-18 20:45:58 +00:00
Dimitri John Ledkov
ea74634e93 questions 2014-12-18 20:44:02 +00:00
Dimitri John Ledkov
1558b91dde misc.py 2014-12-18 20:34:04 +00:00
Dimitri John Ledkov
1bbedd4ddd lpapicache 2014-12-18 20:28:48 +00:00
Dimitri John Ledkov
0c211c1bc7 lp/libsupport.py 2014-12-16 02:54:30 +00:00
Dimitri John Ledkov
65ab539516 harvest.py 2014-12-16 02:48:52 +00:00
Dimitri John Ledkov
a7dedd9296 archive.py 2014-12-16 02:38:52 +00:00
Dimitri John Ledkov
d4f6ef320e remains of mox 2014-12-16 01:44:13 +00:00
Dimitri John Ledkov
88e3d1d6ba Port http_mock to mock. 2014-12-15 04:24:41 +00:00
Dimitri John Ledkov
522030be12 don't keep unused mocks 2014-12-15 03:47:59 +00:00
Dimitri John Ledkov
72487d0477 Stubout 2014-12-15 03:42:49 +00:00
Dimitri John Ledkov
7d70b6b3a3 Dropping mox 2014-12-15 03:25:41 +00:00
Daniel Holbach
a46a78b97f mk-sbuild: better message for cross build so that new start have
correct sbuild command from the last message of mk-sbuild.
2014-07-25 09:50:59 +02:00
Y.C cheng
cbc2e76c74 message fix 2014-07-16 14:46:17 +08:00
Y.C cheng
7f13148ef4 mk-sbuild: better message for cross build, good for new starter 2014-07-16 07:23:54 +08:00
Logan Rosen
bd226fc4e6 pbuilder-dist: Fix yes/no for unknown distribution (LP: #1311884). 2014-04-23 17:24:49 -04:00
Benjamin Drung
383cb8afef releasing package ubuntu-dev-tools version 0.153 2014-04-15 13:39:56 +02:00
Benjamin Drung
1c9762c3eb Reword changelog entry to make lintian happy. 2014-04-15 13:16:45 +02:00
Benjamin Drung
fbf0dcb259 pbuilder-dist: Store build logs in <source>_<version>_<arch>.build instead of last_operation.log
This avoids overwriting build logs.
2014-04-15 13:06:55 +02:00
Benjamin Drung
d850fc8cab Move Version class into ubuntutools module. 2014-04-15 13:01:16 +02:00
Benjamin Drung
12ee7e71e3 pbuilder-dist: Set different aptcache directories for Debian and Ubuntu. 2014-04-15 12:03:14 +02:00
Benjamin Drung
b0209ce796 pbuilder-dist: PEP 8 fixes. 2014-04-15 11:25:28 +02:00
Benjamin Drung
50e589a239 check-mir: Fix remaining PEP 8 issues (and use future print function). 2014-03-18 23:54:36 +01:00
Benjamin Drung
ad94031d84 Remove trailing spaces. 2014-03-18 23:31:19 +01:00
Robie Basak
02d3f8f3a0 Fix pep8 violation (line length) in previous commit 2014-03-17 08:18:22 +00:00
Robie Basak
c1e3ca14dc check-mir: correctly parse dependencies with architecture specifications 2014-03-17 08:15:17 +00:00
Stefano Rivera
349ba9ef90 Explicitly use xz compression when building source packages, rather than
relying on dpkg >= 1.16.5 behavior.
2014-02-25 23:28:10 +02:00
Stefano Rivera
e21f15865c * Thanks for the NMU, Paul.
* Non-maintainer upload.
* Change debian.tar.gz to debian.tar.xz (Closes: #738413)
2014-02-25 22:46:10 +02:00
Benjamin Drung
48d0285c93 releasing package ubuntu-dev-tools version 0.152 2014-01-06 22:51:32 +01:00
Benjamin Drung
75fd3b13bf Bump Standards-Version to 3.9.5. 2014-01-06 22:48:08 +01:00
Dimitri John Ledkov
1ecf020703 * Add ppc64el to valid architectures in pbuilder-dist and ubuntu-build.
* Simplify mirror detection in mk-sbuild, all supported releases, all
  architectures but i386/amd64 are on ports.ubuntu.com
2013-12-20 15:03:55 +00:00
Benjamin Drung
1ea8a4ef18 releasing package ubuntu-dev-tools version 0.151 2013-10-23 14:12:57 +02:00
Benjamin Drung
b07271fdf8 Remove unused imports. 2013-10-23 00:36:12 +02:00
Dmitrijs Ledkovs
585902ad87 always done from unstable. Adjust requstsync & syncpackage to always
default to unstable.
2013-10-22 18:58:48 +01:00
Dmitrijs Ledkovs
6f692c08a1 Fix syncpackage manpage 2013-10-22 18:57:31 +01:00
Dmitrijs Ledkovs
f07c0f8ccb Since Britney migration was introduced in Ubuntu, automatic syncing is
always done from unstable.
2013-10-22 17:04:15 +01:00
Benjamin Drung
0b6ba08175 releasing package ubuntu-dev-tools version 0.150 2013-10-14 22:09:27 +02:00
Benjamin Drung
5a8b4f9682 Switch to debhelper 9. 2013-10-14 22:08:09 +02:00
Dmitrijs Ledkovs
06874a8bad add arm64 knowledge to mk-sbuild, ubuntu-build, pbuilder-dist. 2013-10-13 21:54:31 +01:00
Brian Murray
cc0e65e51c fix typo in changelog 2013-08-22 08:46:16 -07:00
Brian Murray
0ee01ef534 ubuntutools/sponsor_patch/sponsor_patch.py: correct grammar regarding
which task for the patch, cache bug.id instead of retrieving it up more
than once .
2013-08-22 08:22:55 -07:00
Benjamin Drung
769ccd0f62 releasing version 0.149 2013-08-13 23:12:50 +02:00
Marc Deslauriers
79abf8a50f * ubuntutools/config.py: properly handle name being None. 2013-08-13 17:01:32 -04:00
Martin Pitt
22a7f51a9a Only conclude that we don't need an orig tarball if we're sent to the
librarian (as opposed to the login page from a private PPA).
(LP: #1106429)
2013-07-23 12:49:00 +02:00
Evan Broder
2b5e91e32e Only conclude that we don't need an orig tarball if we're sent to the
librarian (as opposed to the login page from a private PPA). (LP:
#1106429)
2013-07-12 13:38:32 -07:00
Martin Pitt
6b84afdeeb backportpackage: Fix destination for --dont-sign option. (LP: #1183985) 2013-05-27 10:20:59 +02:00
Adam Gandelman
a26129d283 backportpackage: Fix destination for --dont-sign option. (LP: #1183985) 2013-05-24 12:58:12 -07:00
Loïc Minier
ef37995a71 Merge lp:~lool/ubuntu-dev-tools/fix-non-ascii-name; ubuntutools.config: decode
developer names with the current locale's encoding and add corresponding test;
fixes handling of non-ascii names.
2013-05-21 14:38:39 +02:00
Loïc Minier
658946c214 Encode the developer name in the current locale to run the test; thanks
Stefano Rivera.
2013-05-15 02:18:50 +02:00
Loïc Minier
a41422a7f4 Default to UTF-8 encoding when locale doesn't specify one (as Python defaults
to ascii); thanks Stefano Rivera.
2013-05-15 02:10:04 +02:00
Loïc Minier
0aaa0f1f4a Decode name from environment or from gecos with the locale's encoding and add
corresponding regression test; fixes handling of non-ascii developer name like
mine with e.g. syncpackage using it with dpkg-genchanges -e.
2013-05-13 13:58:15 +02:00
Marc Deslauriers
bcdc6abbf8 mk-sbuild: allow specifying the schroot profile. 2013-05-06 09:47:36 -04:00
Benjamin Drung
b809e2deb0 releasing version 0.148 2013-05-05 19:14:58 +02:00
Dmitry Shachnev
9c28d4db7a Fix a couple of minor errors in manpages AUTHOR sections 2013-04-20 14:09:10 +04:00
Colin Watson
19628caf13 mk-sbuild: Fix comment syntax in proxy configuration (LP: #1163300). 2013-04-02 13:55:07 +01:00
Benjamin Drung
eebe632337 releasing version 0.147 2013-03-19 00:43:44 +01:00
Benjamin Drung
7206593bc9 import-bug-from-debian: Move ubuntutools.logger import before possible usage. 2013-03-19 00:43:31 +01:00
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01:00
Benjamin Drung
70e79d313c Correct changelog entry. 2013-02-28 13:02:14 +01:00
Benjamin Drung
9715d1de0a releasing version 0.146 2013-02-27 19:56:21 +01:00
Benjamin Drung
8440cef85b Bump Standards-Version to 3.8.4 (no changes needed). 2013-02-27 17:55:16 +01:00
Stefano Rivera
374d33464c mk-sbuild: Use the sbuild schroot profile 2013-02-25 23:29:12 +02:00
Scott Moser
59a79376cb mk-sbuild: change lvm volume names to include target (LP: #1087194) 2013-02-13 14:12:06 -05:00
Dmitrijs Ledkovs
c6c7699c86 mk-sbuild: Change cross-chroot's lvm volume names to be inline with non-lvm/sbuild. 2013-02-12 11:03:04 +00:00
Colin Watson
77bde6c1c0 mk-sbuild: Drop -cross from cross-building chroots, in line with sbuild. 2013-02-05 19:46:02 +00:00
Iain Lane
8bcad215ef Merge trunk 2013-01-16 15:55:02 +00:00
Iain Lane
5d02fe7a3e sponsor-patch: Allow all supported bare releases now that LP rewrites
these to contain '-proposed' for us.
2013-01-16 15:15:50 +00:00
Stefano Rivera
957a73772d mk-sbuild: Name cross chroots after the build architecture and target
(LP: #1087194)
2013-01-12 15:26:08 +02:00
Stefano Rivera
a3bd35bd0c seeded-in-ubuntu: Clarify that "not seeded" binary packages may not exist
(LP: #1029620)
2013-01-12 14:34:04 +02:00
Stefano Rivera
d6d933e8d5 Whitespace 2012-12-12 17:25:44 +02:00
Stefano Rivera
8faeb46334 ubuntu-build: Default to DEV-proposed in batch mode. Thanks Scott
Kitterman(LP: #1088010)
2012-12-12 17:25:20 +02:00
Stefano Rivera
5f3e359ab6 backportpackage: Check that dput is installed when uploading (LP: #1086342) 2012-12-04 16:01:51 +02:00
Stefano Rivera
d9763747d3 Python style 2012-12-03 13:15:27 +02:00
Stefano Rivera
a23998a8f3 backportpackage: Don't ignore -k (LP: #1083688) 2012-12-03 13:13:46 +02:00
Stefano Rivera
fabb0119ef pbuilder-dist: Build with -proposed enabled for Ubuntu dev releases.
Thanks Scott Kitterman (LP: #1082452)
2012-12-02 12:20:02 +02:00
Julian Taylor
487bc3a3c9 stop suggesting ipython, lp-shell has been moved to lptools 2012-11-24 21:36:34 +01:00
Benjamin Drung
b84b312f44 setup-packaging-environment: update developer guide URL (LP: #1068049) 2012-11-10 19:21:10 +01:00
Benjamin Kerensa
71f84d4499 Remove Extra Whitespace 2012-11-09 13:08:05 -08:00
Benjamin Kerensa
d04722f799 Fix Changelog Version 2012-11-09 13:05:03 -08:00
Benjamin Kerensa
c3baa6ecbb Fix setup-packaging-environment developer guide url 2012-11-09 03:09:49 -08:00
Dmitrijs Ledkovs
5575d70531 dgetlp: drop it, and hence remove python-gnupginterface dependency. 2012-11-09 11:02:01 +00:00
Benjamin Drung
34ca8072ff sponsor-patch: Use ubuntu profile when running lintian. 2012-11-08 20:43:55 +01:00
Stefano Rivera
60e063e484 Visually separate the debdiff a little 2012-11-08 10:10:26 +02:00
Stefano Rivera
a9c0df9627 sponsor-patch: Handle staging environment branch URLs 2012-11-06 23:51:59 +02:00
Stefano Rivera
925e1c787e Upload to experimental 2012-11-06 22:58:50 +02:00
Stefano Rivera
07c09fee81 Use the right suite in cross-builds too 2012-11-06 11:48:51 +02:00
Stefano Rivera
143027d9fc Enable the proposed pocket by default 2012-11-06 11:45:24 +02:00
Stefano Rivera
18c8eaddb4 Update copyright for mk-sbuild changes 2012-11-05 10:40:42 +02:00
Stefano Rivera
a87e0b6b80 Move Steve's changelog entry to the right release 2012-10-31 17:39:06 +01:00
Steve Langasek
fd4dde338a Initial support for setting up cross-build chroots. 2012-10-31 14:30:02 +01:00
Steve Langasek
266e9a2df1 Add missing documentation for new --target option 2012-10-31 14:08:59 +01:00
Steve Langasek
a8c89ab3fc Also add dpkg-cross; this is the agreed package to hold things like config.site
overrides for cross-building.
2012-10-31 14:01:14 +01:00
Steve Langasek
9ec2dda809 Add pkg-config-$target_tuple to the cross-build package list, per Wookey's
comments on the contents of the pending cross-build-essential.
2012-10-30 15:03:26 +01:00
Stefano Rivera
e15667aa2f requestsync: We now sync to proposed (LP: #1073060) 2012-10-30 10:18:17 +01:00
Stefano Rivera
87d76c813a syncpackage: Don't throw away release pockets, returning correct errors
when the source and destination match even though the destination release
pocket doesn't.
2012-10-30 09:41:56 +01:00
Stefano Rivera
d826cd20e0 Comment typo 2012-10-29 09:05:28 +01:00
Stefano Rivera
4dc40f4f4a Upload to experimental, due to the freeze 2012-10-29 09:02:44 +01:00
Steve Langasek
0d32f2f838 changelog entry 2012-10-29 01:39:23 +01:00
Steve Langasek
6844b5aa48 suppress the eternally annoying warning message from dpkg-architecture 2012-10-28 18:33:04 +01:00
Steve Langasek
c6c7cc7c1f Initial support for setting up cross-build chroots. 2012-10-28 18:18:04 +01:00
Colin Watson
cc55071afd syncpackage: Default to <current_series>-proposed. 2012-10-25 16:58:10 +01:00
Stefano Rivera
1c698ff626 While we're there, Updates is derived from Proposed 2012-10-22 22:09:31 +02:00
Stefano Rivera
24e1161d3c syncpackage, requestsync: Check the Release pocket if we can't find an
Ubuntu package in the requested pocket. (LP: #1069867)
2012-10-22 21:42:58 +02:00
Stefano Rivera
0adca3f7a1 Use the same construction as pull-debian-source 2012-10-17 22:15:50 +02:00
Stefano Rivera
586197d591 pull-lp-source: Catch errors parsing JSON we got from DDE (LP: #1059848) 2012-10-17 22:14:23 +02:00
Stefano Rivera
73461fca08 ubuntutools.question: Catch EOF and SIGINT on all input and bail out.
(LP: #1037488)
2012-10-08 11:17:50 +02:00
Stefano Rivera
e30a6e51a7 sponsor-patch: Don't fall over bugs targetted at the development release
(LP: #936014)
2012-08-17 22:44:21 +02:00
Benjamin Drung
f29e729852 sponsor-patch: Fix crash if Debian patch contains a slash. 2012-08-01 15:16:34 +02:00
Benjamin Drung
9baf39a262 seeded-in-ubuntu: State in error message that it takes a source package.
LP: #1029155
2012-07-26 21:40:49 +02:00
Stefano Rivera
b3f16cbee2 * requestbackport:
- Avoid duplicate Reverse-Build-Deps when sources build binaries of the
    same name.
  - Explain that backports aren't to fix bugs.
2012-07-18 12:53:50 +02:00
Stefano Rivera
d3971342d8 request-backport: Avoid duplicate Reverse-Build-Deps when sources build
binaries of the same name.
2012-07-18 12:45:47 +02:00
Stefano Rivera
73acf77646 seeded-in-ubuntu Inform the user when we couldn't determine binary
packages built by a source package, as it most recently FTBFS.
2012-07-18 12:28:35 +02:00
Stefano Rivera
c946f9457f sponsor-patch: Pass --builder=dpkg-buildpackage to bzr bd, in case the user has configured a custom builder that doesn't do source builds (LP: #1019817) 2012-07-02 19:27:00 +02:00
Stefano Rivera
4d28dfb9e6 Pass --builder=dpkg-buildpackage to bzr bd, in case the user has
configured a custom builder that doesn't do source builds (LP: #1019817)
2012-07-02 19:24:09 +02:00
Stefano Rivera
0a5812f168 submittodebian: Use --include instead of --attach when not using reportbug's
internal MUA.
2012-07-02 15:05:39 +02:00
Stefano Rivera
a8a1eef67a Use dpkg-buildpackage instead of debuild in submittodebian. It really
doesn't need to run lintian twice.
2012-07-02 13:21:10 +02:00
Benjamin Drung
9b5cfb114d releasing version 0.143 2012-06-22 13:34:50 +02:00
Benjamin Drung
fd07e8e831 Add a man page for the reverse-build-depends wrapper script. 2012-06-22 13:34:18 +02:00
Stefano Rivera
605b27a550 submittodebian; Unset DEBEMAIL when building source package.
(LP: #1015066)
2012-06-20 22:44:12 +02:00
Stefano Rivera
4056e98a43 ubuntutools.archive: Improve error handling around rmadison calls
(LP: #1010951)
2012-06-20 22:32:20 +02:00
Stefano Rivera
fa83ac6b0b seeded-in-ubuntu: Catch errors in parsing data, and don't keep unreadable
data cached (LP: #1008783)
2012-06-20 22:28:35 +02:00
Stefano Rivera
139e5dfda7 backportpackage.1: Document --key and --dont-sign (LP: #1007564) 2012-06-20 22:24:04 +02:00
Stefano Rivera
9f33928d38 submittodebian: Explitictly UTF-8 encode the bug body (LP: #1005834) 2012-06-20 22:20:22 +02:00
Stefano Rivera
4f308cdf62 submittodebian: Style tweaks 2012-06-20 22:17:07 +02:00
Stefano Rivera
1804158370 Correct metavar for --mirror in backportpackage (LP: #999727) 2012-06-20 22:13:49 +02:00
Stefano Rivera
28b475ce7b We now have a bug for the source: -> -source change 2012-06-20 22:02:53 +02:00
Stefano Rivera
b51dddcdc4 Correct spelling mistakes in package description, thanks Logan Rosen for
the patch (Closes: #678245)
2012-06-20 11:40:07 +02:00
Stefano Rivera
c0708dd41b pbuilder-dist: Don't try to enable -updates for the current codename
referring to Debian testing, either (LP: #1011870)
2012-06-19 16:42:59 +02:00
Martin Pitt
3eff164421 Corrected brackets in man-page for sponsor-patch. 2012-06-18 16:36:07 +02:00
Stefano Rivera
d45bb86bcd Work when there's no DEBEMAIL too 2012-06-17 19:54:40 +01:00
Iain Lane
024e48dcba backportpackage: Unset DEBEMAIL when building source package. Fixes error
when building backports for packages with no Ubuntu changes. (LP: #1007042)
2012-06-17 19:50:15 +01:00
Iain Lane
2861c54ad7 backportpackage: Unset DEBEMAIL when building source package.
Fixes error when building backports for packages with no Ubuntu changes. This
happens because Ubuntu has a policy of requiring that the Maintainer field of
Ubuntu-modified packages be set to an @ubuntu.com address. Normally this is a
warning, except when the uploader (determined by DEBEMAIL) is @ubuntu.com. In
that case it's an error and the source package build is aborted. We don't want
this behaviour for backports, so unset DEBEMAIL to make the error a warning
again.

LP: #1007042
2012-06-13 23:21:17 +01:00
Mathieu Trudel-Lapierre
e43486d4a1 mk-sbuild: use and update messages to suggest using the source:$chroot way
of referring to source chroots instead of $chroot-source; since the latter
does not work with btrfs snapshot-based chroots.
2012-06-06 17:48:12 +01:00
Mathieu Trudel-Lapierre
885c0f90ec mk-sbuild: use and update messages to suggest using the source:$chroot way
of referring to source chroots instead of $chroot-source; since the latter
does not work with btrfs snapshot-based chroots.
2012-06-06 09:55:08 -04:00
Stefano Rivera
aa2730f07f backportpackage: Fix filenames searched when looking for existing
.orig.tar.foo files (to determine if we need to upload it again or not).
(LP: #1007908)
2012-06-03 00:57:29 +01:00
Iain Lane
f521caa013 backportpackage: Fix filenames searched when looking for existing .orig.tar.foo files
(to determine if we need to upload it again or not).

We need to look for package_upstreamversion.orig.tar.foo, not
package_fullversion.orig.tar.foo.

LP: #1007908
2012-06-02 20:34:20 +01:00
Stefano Rivera
026272428d Upload to unstable 2012-05-28 23:36:09 +01:00
Benjamin Drung
337917c4d9 Break long lines into two commands. 2012-05-27 00:46:24 +02:00
Stefano Rivera
93fbe4c71c Update sponsor-patch to use the new API resulting from this change
(LP: #1002999)
2012-05-25 12:15:33 +01:00
Stefano Rivera
c759e49570 We have a bug for outdated distro-info, let's close it 2012-05-22 15:12:35 -07:00
Evan Broder
cdde59f436 Typo fix 2012-05-13 14:06:09 -07:00
Evan Broder
4ef5a12e60 backportpackage: Pass -v to debuild with last published version
number. This matches the way backports have traditionally been
generated by archive admins.
2012-05-13 14:05:53 -07:00
Evan Broder
3136efc10d backportpackage: Switch to ~ubuntu12.04.1-style version numbers
instead of ~precise1, to make our version numbers more future-proof.
2012-05-13 13:49:49 -07:00
Stefano Rivera
4f66ed834b Move reportbug existance check after argument parsing 2012-05-12 19:21:39 -07:00
Stefano Rivera
0f5ab96310 * check-mir, check-symbols, grep-merges, pbuilder-dist-simple,
setup-packaging-environment, submittodebian, ubuntu-iso:
  Do enough argument parsing to handle --help (LP: #988009)
* dgetlp: Require a UTF-8 locale, or it'll crash when displaying errors
  (LP: #979117)
* pbuilder-dist: Don't try to enable -updates for Debian testing
  (LP: #993006)
* pbuilder-dist, pull-debian-source, pull-lp-source, requestsync,
  reverse-depends, submittodebian, syncpackage:
  Handle outdated distro-info data. Fall back to sane defaults where
  possible.
* backportpackage: Avoid uploading orig tarballs if they are already present
  in the destination PPA (LP: #691897)
* Allow mk-sbuild to be run by root if a configuration file exists
  (LP: #888736)
* backportpackage: Allow unsigned backports (LP: #992739)
* update-maintainer: Add a function to restore the original maintainer.
* submittodebian: Revert Ubuntu Maintainer mangling, and re-build the source
  package before diffing. (LP: #902233)
2012-05-11 18:13:04 -07:00
Evan Broder
fdbf495f15 backportpackage: Add -c, --close flag to include a changelog closer. 2012-05-11 09:56:19 -07:00
Stefano Rivera
055dce8f40 submittodebian: Revert Ubuntu Maintainer mangling, and re-build the source
package before diffing. (LP: #902233)
2012-05-06 19:46:05 +02:00
Stefano Rivera
d692d7b79b update-maintainer: Add a function to restore the original maintainer. 2012-05-06 19:42:39 +02:00
Stefano Rivera
ebe44bf04e backportpackage: Allow unsigned backports (LP: #992739) 2012-05-06 13:09:54 +02:00
Stefano Rivera
b84c4d8530 Allow mk-sbuild to be run by root if a configuration file exists
(LP: #888736)
2012-05-06 12:40:47 +02:00
Stefano Rivera
314ed77d77 backportpackage: Avoid uploading orig tarballs if they are already present
in the destination PPA (LP: #691897)
2012-05-06 12:32:54 +02:00
Stefano Rivera
343ac49b39 pbuilder-dist, pull-debian-source, pull-lp-source, requestsync,
reverse-depends, submittodebian, syncpackage:
Handle outdated distro-info data. Fall back to sane defaults where
possible.
2012-05-06 10:15:54 +02:00
Stefano Rivera
4dbde5f886 pbuilder-dist: Don't try to enable -updates for Debian testing
(LP: #993006)
2012-05-06 08:36:37 +02:00
Stefano Rivera
165bb84bf5 dgetlp: Require a UTF-8 locale, or it'll crash when displaying errors
(LP: #979117)
2012-05-06 06:27:32 +02:00
Stefano Rivera
e47a99c42a setup-packaging-environment: Display help 2012-05-06 06:06:41 +02:00
Stefano Rivera
2a2e420353 pbuilder-dist-simple: Display help 2012-05-06 06:03:14 +02:00
Stefano Rivera
ed96c35dc1 grep-merges: Use optparse to display --help 2012-05-06 05:24:14 +02:00
Stefano Rivera
927947841c ubuntu-iso: Use optparse to display --help 2012-05-06 05:18:05 +02:00
Stefano Rivera
d69622fa9c check-symbols: Use optparse to display --help 2012-05-06 05:12:40 +02:00
Stefano Rivera
b26dbaee68 check-mir: Use optparse to display --help 2012-05-05 19:37:41 +02:00
Stefano Rivera
083d44f676 submittodebian: Use optparse to display --help (LP: #988009) 2012-05-05 19:34:02 +02:00
Stefano Rivera
b8a2ca9e5a pbuilder-dist: improve bash_completion for *.dsc files. Thanks Maarten
Bezemer. (Closes: #670924, LP: #770529)
2012-04-30 16:10:58 +02:00
Stefano Rivera
71aab84949 mk-sbuild: Support kmod, when checking for overlayfs availability. 2012-04-25 17:40:33 +02:00
Stefano Rivera
4019f98594 Upload to unstable 2012-04-12 23:47:02 +02:00
Stefano Rivera
42d9c851f1 syncpackage: Log into Launchpad anonymously with --no-lp 2012-04-12 18:31:36 +02:00
Stefano Rivera
b05cbfd8f9 seeded-in-ubuntu: Log into launchpad anonymously (LP: #979849) 2012-04-12 18:23:00 +02:00
Stefano Rivera
36088bad6c Upload to unstable 2012-03-29 00:02:00 +02:00
Stefano Rivera
42a76abaa7 Catch SeriesNotFoundException and display a friendly error (LP: #963888) 2012-03-28 23:51:17 +02:00
Stefano Rivera
d9bf247dee * requestsync:
- New packages from non-free or contrib go into multiverse (LP: #935643)
2012-03-28 23:43:29 +02:00
Stefano Rivera
18f3109cee * backportpackage
- Prompt to delete existing workdirs (LP: #885514)
  - Support a BACKPORTPACKAGE_UPLOAD configuration/enviornment variable
    (LP: #693217)
2012-03-28 23:25:33 +02:00
Stefano Rivera
3c81209b34 backportpackage: Prompt to delete existing workdirs (LP: #885514) 2012-03-28 14:47:30 +02:00
Stefano Rivera
ecc9501387 pull-debian-source: Handle JSON parsing failures in DDE responses 2012-03-28 14:27:37 +02:00
John S Gruber
6e7a7bac35 Don't use --override-config with operations other than update. (LP: #409696) 2012-03-26 10:42:09 +02:00
Stefano Rivera
c58f620d09 Update the ubuntutools.archive test suite to handle the proxy change. 2012-03-26 10:02:41 +02:00
Stefano Rivera
52fc42ca8f Make ubuntutools.archive a little more testable, by making its urlopener an
instance property.

Replace these with mocks, as needed, rather than mocking out urllib2.urlopen.

Makes the test suite pass again.
2012-03-26 10:00:46 +02:00
Stefano Rivera
872957da4e Whitespace 2012-03-26 09:41:05 +02:00
Martin Pitt
790fb3a31a pbuilder-dist: Do not force default value for --aptcache argument
(LP: #956903)
2012-03-19 06:41:55 +01:00
Daniel Holbach
63aedf6912 merged lp:~blueyed/ubuntu-dev-tools/use-proxy-for-download 2012-03-18 20:25:06 +01:00
Daniel Hahler
ee569590a6 ubuntutools/archive.py: use ProxyHandler in _download_file.
This makes use of the system proxy (e.g. http_proxy).
2012-03-16 16:22:14 +01:00
Daniel Hahler
dead85ee75 pbuilder-dist: Do not force default value for --aptcache argument
Instead of passing the default from /usr/share/pbuilder/pbuilderrc to
pbuilder, let it be configured from the config files, e.g. ~/.pbuilderrc.
(LP: #956903)
2012-03-16 14:49:32 +01:00
Evan Broder
2e9d81bdda Add KEYID config var to be specified package-globally
The KEYID variable is currently supported by 3 scripts: requestsync,
sponsor-patch, and syncpackage
2012-03-03 15:54:35 -08:00
Stefano Rivera
346aae9d42 pbuilder-dist: Use the same chroot, whether the system-architecture was
the supplied architecture or was chosen by default (LP: #943435)
2012-02-29 23:23:05 +02:00
Benjamin Drung
0eb6010448 Add missing slash in copyright format URL. 2012-02-25 15:42:08 +01:00
Stefano Rivera
40380a96c4 * Bump Standards-Version to 3.9.3, no changes needed.
* Update machine-readable copyright Format to 1.0.
2012-02-25 16:11:55 +02:00
Stefano Rivera
b5bec951c0 Upload to unstable 2012-02-15 17:38:42 +02:00
Stefano Rivera
f17b90d30c reverse-build-depends: Don't break during --help unit tests in a minimal environment 2012-02-15 17:30:11 +02:00
Stefano Rivera
b1eda34239 Actually add reverse-build-depends 2012-02-15 17:24:36 +02:00
Stefano Rivera
767951addb backportpackage: Map Debian release aliases to codenames (LP: #918231) 2012-02-15 16:57:17 +02:00
Stefano Rivera
fdbb9b345c Provide transitional reverse-build-depends wrapper to help users
discover reverse-depends. (LP: #910420)
2012-02-15 16:42:58 +02:00
Stefano Rivera
2afe15c4a3 pbuilder-dist: Pass DEB_BUILD_OPTIONS through (LP: #685786) 2012-02-15 16:24:14 +02:00
Stefano Rivera
f363b745ff pbuilder and cowbuilder live in sbin 2012-02-15 16:21:00 +02:00
Stefano Rivera
30da459114 Check for dependencies that the package doesn't Depend on. Recommend
dput, lintian, patch, quilt. (LP: #846385)
2012-02-15 16:10:43 +02:00
Stefano Rivera
948032d8a3 Support syncs from a non-default series (LP: #931644) 2012-02-15 15:16:30 +02:00
Stefano Rivera
aafcbd082e sponsor-patch: Support syncs of new packages. 2012-02-15 15:05:46 +02:00
Stefano Rivera
03e13834b9 sponsor-patch, requestsync, syncpackage: Add a config variable for -k
arguments.
2012-02-14 01:22:38 +02:00
Evan Broder
cb225bd8f2 sponsor-patch, requestsync, syncpackage: Add a config variable for -k arguments 2012-02-11 11:59:46 -08:00
Stefano Rivera
08754a3c71 * reverse-depends: Now that Debian is supported server-side:
- Convert Debian release aliases to codenames.
  - Default to the devel release of the vendor distribution.
2012-02-08 12:06:32 +02:00
Stefano Rivera
d373b65c3e attribution 2012-02-08 01:07:00 +02:00
Stefano Rivera
0713ff4f94 pbuilder-dist: Export DISTRIBUTION and ARCHITECTURE as well as DIST and
ARCH. (Closes: #659060, LP: #423609)
2012-02-08 01:05:15 +02:00
Alessio Treglia
4e8e44a788 The same of the previous commit, replace ARCH with ARCHITECTURE (as per pbuilderrc's manpage) 2012-02-07 22:27:09 +01:00
Alessio Treglia
f245b24f30 Use DISTRIBUTION instead of DIST to override the default distribution of {p,cow}builder-dist.
Closes: #659060
2012-02-07 22:14:13 +01:00
Stefano Rivera
a9386ef070 Improve error message when LP's package importer is out of date 2012-01-23 16:51:19 +02:00
Stefano Rivera
682f5859ae Re-add dgetlp. Still needed for downloading source packages from +queue.
(LP: #919805)
2012-01-22 21:26:39 +02:00
Stefano Rivera
a0a25fc6ea sponsor-patch: Determine the task from the UDD branch. 2012-01-09 22:03:28 +02:00
Stefano Rivera
e44205bb33 bzr bd argument order matters 2012-01-09 21:44:06 +02:00
Stefano Rivera
f124357734 syncpackage, backportpackage, sponsor-patch: Use -nc when building source
packages. Avoids needing build-deps on the build machine.
2011-12-23 22:34:54 +02:00
Benjamin Drung
69d226d489 releasing version 0.138 2011-12-21 22:38:52 +01:00
Stefano Rivera
12329170f1 syncpackage: Mention sponsorship when closing bugs (LP: #904288) 2011-12-21 23:18:22 +02:00
Benjamin Drung
9e1a6f6ff9 backportpackage: Drop unused imports. 2011-12-21 22:13:25 +01:00
Benjamin Drung
bbfbfd8956 Allow user to override sanity checks (LP: #896733). 2011-12-21 22:09:53 +01:00
Stefano Rivera
e1e13bbfdc Wrong bug 2011-12-21 22:50:34 +02:00
Stefano Rivera
705335a220 backportpackage: Add --release-pocket option, rather than relying entirely
on heuristics (Closes: #652000)
2011-12-21 22:49:24 +02:00
Benjamin Drung
3f6eb545e2 sponsor-patch: Check if the sponsored bug is marked as duplicate (LP: #896733). 2011-12-21 21:44:22 +01:00
Stefano Rivera
fb44f55379 Remove redundant optparse parameters from backportpackage 2011-12-21 22:31:33 +02:00
Stefano Rivera
edea7a2b9c Remove blatent lie from ubuntu-build's manpage 2011-12-20 02:02:22 +02:00
Stefano Rivera
d3144ea253 mk-sbuild: Don't install devscripts by default (LP: #904502) 2011-12-16 15:33:11 +02:00
Stefano Rivera
3f1644fad6 Correct reference to qemu-user-static in pbuilder-dist.1 (Closes: #651999) 2011-12-16 15:08:10 +02:00
Benjamin Drung
58e6dfbbdb sponsor-patch: Use syncpackage instead of subscribing ubuntu-archive for sync requests, because syncpackage supports sponsorship now. 2011-12-10 12:51:53 +01:00
Stefano Rivera
9482e7b9f9 Upload to unstable 2011-12-09 12:59:49 +02:00
Stefano Rivera
919f091820 syncpackage: Support sponsorship for native-syncs, now that LP does. 2011-12-09 10:55:18 +02:00
Stefano Rivera
34efc162a2 And another rename, let this be the last 2011-12-09 00:23:07 +02:00
Scott Moser
c4a2361451 mk-sbuild: fix embarrasing bad logic error in http_proxy usage. Thanks Scott 2011-12-08 11:04:54 +01:00
Scott Moser
3f08738b67 mk-sbuild: fix embarrasing bad logic error in http_proxy usage
The logic here is simply wrong, and it would result in setting
proxy to empty value if DEBOOTSTRAP_PROXY or http_proxy was
non-empty.
2011-12-08 02:23:09 -05:00
Stefano Rivera
671fcab5c8 New Tool: ubuntu-is-seeded: Query a package's seed status. Whether it is on current daily images and/or part of the supported seed. 2011-12-08 03:00:12 +02:00
Stefano Rivera
067fd52b5c binpkg (from srcpkg) is ... 2011-12-08 00:29:20 +02:00
Stefano Rivera
a3f9eeed9f Verboser output, but without duplication. This should please bdrung 2011-12-08 00:27:58 +02:00
Stefano Rivera
8e341da95c Merge from trunk 2011-12-08 00:03:37 +02:00
Stefano Rivera
df04e14503 New URL for the data 2011-12-08 00:01:56 +02:00
Stefano Rivera
784efd7053 Rename again 2011-12-07 23:55:17 +02:00
Stefano Rivera
75c139ace8 The parameter is sponsored 2011-12-07 15:46:21 +02:00
Stefano Rivera
a55229619e Pass the launchpadlib person object to copyPackages 2011-12-07 15:46:09 +02:00
Stefano Rivera
e4fcb01b6a Whoops, changed an option name, but not its variable 2011-12-07 01:29:16 +02:00
Stefano Rivera
8178324266 Make syncpackage print a warning when --no-lp is used 2011-12-07 01:23:06 +02:00
Stefano Rivera
73f2273d71 Typo 2011-12-07 01:19:02 +02:00
Stefano Rivera
198d5a8720 Correct logic for obtaining email address for --no-lp sponsorship syncs 2011-12-07 01:18:24 +02:00
Stefano Rivera
6ad66e3d42 re-wrap changelog 2011-12-07 01:09:07 +02:00
Stefano Rivera
90628d7ee7 Changelog entry 2011-12-07 01:07:58 +02:00
Stefano Rivera
bba53d9f7a Corrosponding manpage improvements 2011-12-07 01:07:28 +02:00
Stefano Rivera
c289c20b88 Spelling 2011-12-07 01:03:35 +02:00
Stefano Rivera
8ca2144a74 --no-lp *itself* could get some love, too 2011-12-07 00:51:48 +02:00
Stefano Rivera
b771bf89b0 Clarify --no-lp 2011-12-07 00:48:13 +02:00
Stefano Rivera
79e525d260 Break up some long lines into multiple statements 2011-12-07 00:42:34 +02:00
Stefano Rivera
dc9d6b5bf3 Add sponsorship support 2011-12-07 00:23:22 +02:00
Stefano Rivera
1f2d2e8d62 Pyflakes & PEP-8 fine-tooth comb applied 2011-12-07 00:14:00 +02:00
Stefano Rivera
857778b922 Remove unecessary optparse clutter 2011-12-07 00:01:08 +02:00
Stefano Rivera
86ba4c99ca move --no-lp options into their own group 2011-12-06 23:37:25 +02:00
Stefano Rivera
b4e0849690 un-copy-paste a little 2011-12-06 00:29:32 +02:00
Stefano Rivera
f4793f0df0 Tighter output 2011-12-06 00:24:11 +02:00
Stefano Rivera
7d5efa8a76 Rename to ubuntu-safe-to-upload 2011-12-05 22:49:10 +02:00
Stefano Rivera
89e15a2f5d New Tool: ubuntu-upload-permission: Query upload permissions (LP: #876554) 2011-12-04 00:53:37 +02:00
Stefano Rivera
2da0560c68 Mention backportpackage in debian/control 2011-12-04 00:45:26 +02:00
Stefano Rivera
973e1b51c1 Missed update-maintainer 2011-12-04 00:42:09 +02:00
Stefano Rivera
4988d36ba2 Extra bits 2011-12-04 00:39:40 +02:00
Stefano Rivera
a22f4eebab Rename again 2011-12-04 00:35:49 +02:00
Stefano Rivera
405a3c3327 non-release pockets are ok for non-dev releases 2011-12-04 00:31:23 +02:00
Stefano Rivera
ff644a2ca1 Actually, skip all upload rights when the release is non-dev 2011-12-04 00:26:59 +02:00
Stefano Rivera
25694bdfdd Don't list None as a release 2011-12-04 00:26:39 +02:00
Stefano Rivera
dcef46eeea Don't list component upload rights for non-dev series 2011-12-04 00:20:06 +02:00
Stefano Rivera
3a403daf6b Tweak minimal output 2011-12-04 00:18:23 +02:00
Stefano Rivera
09a870fa43 Some error handling (and other bits) 2011-12-04 00:09:51 +02:00
Stefano Rivera
d420a25b94 Pocket awareness 2011-12-04 00:08:08 +02:00
Stefano Rivera
58ee0de242 Catch PackageNotFoundException 2011-12-03 23:51:24 +02:00
Stefano Rivera
0d2d356ddb Break up main() 2011-12-03 23:50:11 +02:00
Stefano Rivera
6ef82feac4 Manpage and other accoutrements 2011-12-03 23:36:10 +02:00
Stefano Rivera
710aa8aa5a Rename tool, and make output less verbose by default 2011-12-03 23:26:12 +02:00
Stefano Rivera
3ea5038905 PEP8 and docstring improments 2011-12-03 22:44:13 +02:00
Stefano Rivera
89192f4e69 UI tweaks 2011-12-03 22:37:55 +02:00
Stefano Rivera
121af2e631 requestsync: Give user option to retry in case of temporary error (LP: #850360) 2011-12-03 22:07:41 +02:00
Stefano Rivera
e68d3a699d Bump logging level of 'connecting' message 2011-12-03 22:07:18 +02:00
Stefano Rivera
9442e2ea30 Catch response exceptions in the DATA phase 2011-12-03 22:06:49 +02:00
Stefano Rivera
899d1b5361 Use tempfile 2011-12-03 21:57:11 +02:00
Andreas Moog
8a6502aaa4 Use regex to filter unwanted characters in filename 2011-12-03 18:09:49 +01:00
Andreas Moog
32a85dc172 Add a exception for disconnected server 2011-12-03 18:01:55 +01:00
Stefano Rivera
30cb57b32c Initial pkg-on-images tool 2011-12-03 17:02:47 +02:00
Andreas Moog
d18a35c449 Also allow retry if recipient got rejected 2011-12-03 11:57:18 +01:00
Andreas Moog
12030d99e9 Use bugtitle as temporary filename 2011-12-03 11:12:11 +01:00
Andreas Moog
fce947e0f4 Merge trunk 2011-12-03 10:32:36 +01:00
Stefano Rivera
2e8f16c972 submittodebian: rm the tmpdir with a little more force (shutil.rmtree) (LP: #899399) 2011-12-03 00:06:35 +02:00
Stefano Rivera
bb1dcea894 And VISUAL 2011-12-03 00:03:00 +02:00
Stefano Rivera
5b8ac8354e submittodebian: Do the report boiler-plate checking in a script that wraps
an editor, so that we only edit the report once, after checking for
duplicates.
2011-12-02 23:42:29 +02:00
Stefano Rivera
ff9305976b submittodebian: Check existing bug reports before editing anything. 2011-12-02 21:33:10 +02:00
Andreas Moog
9199747fc3 Space after comma 2011-12-02 20:06:57 +01:00
Andreas Moog
6c36b6dd6c Merge trunk 2011-12-02 20:06:16 +01:00
Stefano Rivera
e556fdae00 New Tool: who-can-upload (LP: #876554) 2011-12-02 18:59:46 +02:00
Stefano Rivera
9c20cc13a3 pull-debian-source, pull-lp-source: Resolve the source package (via DDE),
if a binary package was requested (LP: #617349)
2011-12-02 15:22:57 +02:00
Stefano Rivera
75067b3cf3 Add getPublishedBinaries to lpapicache.Archive 2011-12-02 15:01:19 +02:00
Christopher James Halse Rogers
88fe0e1bb8 grep-merges: Use UTF-8 encoding 2011-12-02 12:15:27 +11:00
Andreas Moog
3fca602809 grep-merges: We already require a UTF-8 enabled terminal, so encode
package and uploader name in UTF-8 (LP: #694388)
2011-11-30 21:05:17 +01:00
Andreas Moog
9d227eb205 Merge with trunk 2011-11-29 20:21:44 +01:00
Andreas Moog
0e3a831df9 Use Logger.normal 2011-11-29 20:20:25 +01:00
Stefano Rivera
fc9ddd974e mk-sbuild, pbuilder-dist, ubuntu-build: Add armhf. 2011-11-29 11:42:40 +02:00
Andreas Moog
10e9b18ca7 Save a temporary file in case sending fails 2011-11-28 20:50:28 +01:00
Andreas Moog
d9c00752c0 Wrap long line 2011-11-28 19:53:23 +01:00
Andreas Moog
1034cd0cb4 Merge with trunk 2011-11-27 22:14:59 +01:00
Andreas Moog
677e1b8e4e requestsync: Give user option to retry in case of temporary error (LP: #850360) 2011-11-27 22:14:05 +01:00
Stefano Rivera
ea962ee2ac sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884) 2011-11-27 21:02:48 +02:00
Andreas Moog
73843307f0 Use variable for caching, not lpapicache 2011-11-27 19:46:53 +01:00
Andreas Moog
053b4dcc30 [sponsor-patch] Use api cache for sponsors-team 2011-11-27 17:38:41 +01:00
Andreas Moog
5f27c4c1e7 sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884) 2011-11-27 16:47:38 +01:00
Andreas Moog
20e757b2a5 * sponsor-patch: Build a source package for lintian to run on, when not
test-building syncs.
* sponsor-patch: Check the bug's title, not the task, when determining
  source series for syncs.
2011-11-27 16:40:16 +01:00
Stefano Rivera
42e8c8b643 sponsor-patch: Check the bug's title, not the task, when determining
source series for syncs.
2011-11-27 17:30:14 +02:00
Stefano Rivera
d0f707f33d sponsor-patch: Build a source package for lintian to run on, when not
test-building syncs.
2011-11-27 17:20:58 +02:00
Stefano Rivera
83f9fba796 whitespace... 2011-11-27 17:20:40 +02:00
Andreas Moog
8d551acfb5 Correct syntax error 2011-11-27 16:00:05 +01:00
Andreas Moog
7ed4347de5 sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884) 2011-11-27 15:54:53 +01:00
Stefano Rivera
d30ffe59bc Improve error message when sponsor-patch is called without -s, for a sync 2011-11-27 15:55:56 +02:00
Stefano Rivera
e56edac012 Correct changelog versioning, remove unecessary entry 2011-11-25 16:20:22 +02:00
Stefano Rivera
8d83b9b1de EditBugReport: Correct typo. 2011-11-25 15:46:48 +02:00
Stefano Rivera
430fc81aab Check that there are published binaries (i.e. not stuck in bin-NEW). 2011-11-25 15:40:05 +02:00
Stefano Rivera
9ba1790863 pull-lp-source, requestbackport: Take the latest version from any
non-backports pocket. Implemented by making lpapicache's getSourcePackage
smarter.
2011-11-23 01:45:49 +02:00
Stefano Rivera
7dfb6c3ed7 requestbackport: Check for existing backport bugs first. 2011-11-22 23:48:30 +02:00
Stefano Rivera
70a035f13d Use httplib2 everywhere that we do https. The python stdlib doesn't do
certificate verification.
2011-11-22 15:57:02 +02:00
Stefano Rivera
b70681960f Remove dgetlp. No longer needed. 2011-11-22 14:39:50 +02:00
Stefano Rivera
5920bb9b35 mk-sbuild: Make --eatmydata command line flag actually work. 2011-11-21 09:47:46 +02:00
Stefano Rivera
af440c1703 Remove all newlines from titles 2011-11-16 15:47:58 +02:00
Stefano Rivera
41917433bd Sign changelog as me 2011-11-16 14:33:18 +02:00
Stefano Rivera
8c63520bac Upload to unstable, some nasty regressions 2011-11-16 14:32:12 +02:00
Stefano Rivera
31e6991f24 EditBugReport: Don't include a newline in the bug title. 2011-11-16 14:31:35 +02:00
Stefano Rivera
26ff36479a EditFile: Don't try and store temporary files in /usr/bin. 2011-11-16 13:57:27 +02:00
Stefano Rivera
fc669d8645 mk-sbuild: debootstrap with all components, so that eatmydata can be
installed.
2011-11-16 13:53:29 +02:00
Stefano Rivera
c85373f911 mk-sbuild,doc/mk-sbuild.1: aufs may still be used if overlayfs isn't
available (as is the case on Debian).
2011-11-16 13:52:18 +02:00
Marc Deslauriers
08afc2a0a9 mk-sbuild,doc/mk-sbuild.1: switch from aufs to overlayfs, as aufs is no
longer in the Precise kernel.
2011-11-15 16:08:24 -05:00
Stefano Rivera
35b742c1e8 s/progname/prog/ 2011-11-15 12:58:04 +02:00
Stefano Rivera
3560b7a7f8 Bump changelog for the sake of our PPA 2011-11-15 02:01:43 +02:00
Stefano Rivera
b03fb1f73f Upload to unstable 2011-11-15 01:51:56 +02:00
Stefano Rivera
697b8d6bd3 s/m/match/ 2011-11-15 01:51:27 +02:00
Stefano Rivera
82951a2716 Copyright notice 2011-11-15 01:50:55 +02:00
Stefano Rivera
2e217ac51e Add BinaryPackagePublishingHistory to lpapicache 2011-11-15 01:50:04 +02:00
Stefano Rivera
dd7c37e130 package isn't used any more 2011-11-15 01:40:23 +02:00
Stefano Rivera
6a6f0ca9cb Lengthen variable name, we can afford to now 2011-11-15 01:37:29 +02:00
Stefano Rivera
6f9551f1cb pbuilder-dist: Enable non-release pockets by default (LP: #781003) 2011-11-15 01:26:16 +02:00
Stefano Rivera
1a507e34b0 Whoops placeholders had incorect parity 2011-11-13 22:54:32 +02:00
Stefano Rivera
09e468211a Add changelog retrieval to lpapicache, and use this in syncpackage and
requestsync. The changelogs should be available in Launchpad sooner than
Debian PTS.
2011-11-13 22:50:34 +02:00
Stefano Rivera
cefbe3ccc2 * New scripts:
- reverse-depends: Replaces reverse-build-depends. Uses an UbuntuWire
    webservice for determining all reverse(-build)-dependencies for a
    package. (LP: #696373)
  - requestbackport: Files a backport request bug report, including a full
    testing checklist.
* Don't allow boilerplate prompts through in submittodebian and requestsync
  (LP: #887336)
2011-11-13 21:31:01 +02:00
Stefano Rivera
0838fc6390 Actually include the package name in the backportpackage command 2011-11-13 21:16:15 +02:00
Stefano Rivera
3d6d497df3 Don't substitute user's username into the backportpackage example command 2011-11-13 21:09:48 +02:00
Stefano Rivera
f0a0d62a5b Don't allow boilerplate prompts through in submittodebian and requestsync
(LP: #887336)
2011-11-13 21:04:24 +02:00
Stefano Rivera
1f91b015ab Use subprocess and EditFile in submittodebian 2011-11-13 20:54:05 +02:00
Stefano Rivera
629fbd14ad optional_edit was a silly idea 2011-11-13 20:53:39 +02:00
Stefano Rivera
054423d016 Use YesNoQuestion in pbuilder-dist 2011-11-13 20:17:50 +02:00
Stefano Rivera
d4fbed617f Use EditBugReport instead of requestsync's edit_report. Drop that. 2011-11-13 20:15:19 +02:00
Stefano Rivera
f06bc5b375 Add generic file-editing support to ubuntutools.question 2011-11-13 20:14:55 +02:00
Stefano Rivera
cdec3f5868 pbuilder-dist: Support using non-master mirrors. Thanks Mathieu Parent.
(LP: #824285)
2011-11-13 02:32:25 +02:00
Stefano Rivera
ad463fb831 Only display reverse dependency section when there are any 2011-11-13 02:25:42 +02:00
Stefano Rivera
ce61a43a13 Installs and runs 2011-11-13 02:06:52 +02:00
Stefano Rivera
c4c758cc17 Provide installs & removes cleanly checkboxes for each binary package 2011-11-13 02:00:06 +02:00
Stefano Rivera
9d493af4b0 * mk-sbuild:
-Allow creating experimental chroots again (LP: #885499)
  - experimental shouldn't be the default in experimental chroots.
  - Add --eatmydata flag (LP: #888440)
2011-11-13 01:31:02 +02:00
Stefano Rivera
391e9c7f07 experimental shouldn't be the default in experimental chroots. 2011-11-13 00:40:58 +02:00
Stefano Rivera
390d6f5a8d mk-sbuild: Allow creating experimental chroots again (LP: #885499) 2011-11-13 00:40:26 +02:00
Stefano Rivera
12b5dfd4da submittodebian: Use prettier patch filenames (LP: #887333) 2011-11-13 00:09:41 +02:00
Stefano Rivera
45db7b738e What do you know, there was a bug... 2011-11-12 23:39:49 +02:00
Stefano Rivera
8aefff3758 requestsync: Make --lp the default. 2011-11-12 23:33:32 +02:00
Stefano Rivera
3910b88ee9 grab-merge: Use wget -nv rather than -q, so that we see error messages
(LP: #881967)
2011-11-12 23:05:15 +02:00
Stefano Rivera
6e4c276d1f Update metadata 2011-11-12 13:12:15 +02:00
Stefano Rivera
9bcda8d239 Man page for requestbackport 2011-11-12 13:08:42 +02:00
Stefano Rivera
8aa54e7cff Man page for reverse-depends 2011-11-12 13:00:20 +02:00
Stefano Rivera
885b241709 Spelling and help formatting 2011-11-12 12:53:32 +02:00
Stefano Rivera
f6344a01c5 Add bir testing 2011-11-12 11:22:55 +02:00
Stefano Rivera
20cb64e557 If the user names a binary package, determine the source package 2011-11-12 10:57:16 +02:00
Stefano Rivera
84e7c2ccab devscripts.logger 2011-11-12 10:42:47 +02:00
Stefano Rivera
840421c7c6 Look up the reverse dependencies in the target releases, for each binary package build by this source package in the source release 2011-11-12 01:54:04 +02:00
Stefano Rivera
222ab46cff Use a seeded defaultdict for the intermediate data structure, in case of binary package name differences between releases 2011-11-12 01:20:47 +02:00
Stefano Rivera
d125c47081 Iterate over all destination releases 2011-11-12 01:04:11 +02:00
Stefano Rivera
6155633e85 Display reverse depends in requestbackport 2011-11-12 00:46:48 +02:00
Stefano Rivera
6ac3640c95 Display the binary package depended on, when searching by source package 2011-11-12 00:00:44 +02:00
Stefano Rivera
fae3d8db54 Description 2011-11-11 23:47:14 +02:00
Stefano Rivera
7466d8438b r1211 was just crazy 2011-11-11 23:40:30 +02:00
Stefano Rivera
bb4f0d4295 Pass through error messages nicely 2011-11-11 23:38:01 +02:00
Stefano Rivera
c5201e1847 Sort rdepends 2011-11-11 23:32:20 +02:00
Stefano Rivera
3d2127478d Make sure source packages are specified with src: 2011-11-11 23:21:42 +02:00
Stefano Rivera
d0149b00d7 Catch 404s (preliminary support) 2011-11-11 23:13:01 +02:00
Stefano Rivera
8f914adf7a We don't 404 for empty responses any more, that was silly 2011-11-11 19:11:27 +02:00
Stefano Rivera
1948b455be Don't try and look for reverse-Recommends on source packages 2011-11-11 16:42:10 +02:00
Stefano Rivera
ab02df8cd1 Update to newer webservice output. Verbose listing. 2011-11-11 16:31:10 +02:00
Stefano Rivera
c44f53e185 Move the API boundry of ubuntutools.rdepends 2011-11-10 02:05:43 +02:00
Stefano Rivera
fed4e17188 Rdepends client tool 2011-11-09 23:44:22 +02:00
Stefano Rivera
f712a32238 Reset support_gap at LTSs 2011-11-08 00:03:45 +02:00
Stefano Rivera
6be22ce24b Tidy up 2011-11-07 23:35:14 +02:00
Stefano Rivera
532e055b7c Requestbackport script 2011-11-07 23:20:37 +02:00
Benjamin Drung
da18852892 Refactor code. 2011-10-28 13:18:57 +02:00
159 changed files with 12925 additions and 6471 deletions

View File

@ -1,2 +0,0 @@
[BUILDDEB]
native = True

View File

@ -1,9 +0,0 @@
/.shelf/
/build/
/python-build-stamp-*
/debian/files
/debian/ubuntu-dev-tools/
/debian/ubuntu-dev-tools.debhelper.log
/debian/ubuntu-dev-tools.*.debhelper
/debian/ubuntu-dev-tools.substvars
ubuntu_dev_tools.egg-info

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__
*.egg-info

65
.pylintrc Normal file
View File

@ -0,0 +1,65 @@
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=apt_pkg
# Pickle collected data for later comparisons.
persistent=no
# Use all cpus, to speed up testing
jobs=0
[MESSAGES CONTROL]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=fixme,locally-disabled,missing-docstring,useless-option-value,
# TODO: Fix all following disabled checks!
invalid-name,
consider-using-with,
too-many-arguments,
too-many-branches,
too-many-statements,
too-many-locals,
duplicate-code,
too-many-instance-attributes,
too-many-nested-blocks,
too-many-lines,
[REPORTS]
# Tells whether to display a full report or only the messages
reports=no
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=99
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[BASIC]
# Allow variables called e, f, lp
good-names=i,j,k,ex,Run,_,e,f,lp,me,to
[IMPORTS]
# Force import order to recognize a module as part of a third party library.
known-third-party=debian

177
404main
View File

@ -1,177 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2006-2007 (C) Pete Savage <petesavage@ubuntu.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# Copyright 2009 (C) Canonical Ltd. (by Colin Watson <cjwatson@ubuntu.com>)
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL for more details.
#
# ##################################################################
#
# This script is used to check if a package and all its build
# dependencies are in main or not.
import sys
import apt_pkg
import apt
from ubuntutools import subprocess
def process_deps(cache, deps):
"""Takes a list of (build) dependencies and processes it."""
for basedep in [d.or_dependencies[0] for d in deps]:
if not packages.has_key(basedep.name) and basedep.name != '':
# Check the (build) dependencies recursively
find_main(cache, basedep.name)
def get_package_version(cache, distro, pack):
if pack not in cache:
return None
for version in (cache[pack].candidate, cache[pack].installed):
if not version:
continue
for origin in version.origins:
if origin.archive == distro:
return version
return None
# Cache::CompTypeDeb isn't exposed via python-apt
def comp_type_deb(op):
ops = ("", "<=", ">=", "<<", ">>", "=", "!=")
if (op & 15) < 7:
return ops[op & 15]
return ""
def find_main(cache, pack):
"""Searches the dependencies and build dependencies of a package recursively
to determine if they are all in the 'main' component or not."""
global packages
if pack in packages:
return
# Retrieve information about the package
version = get_package_version(cache, distro, pack)
if not version:
packages[pack] = False
return
elif [origin for origin in version.origins if origin.component == 'main']:
packages[pack] = True
return
else:
if not packages.has_key(pack):
packages[pack] = False
# Retrieve package dependencies
process_deps(cache, version.dependencies)
# Retrieve package build dependencies. There's no handy
# attribute on version for this, so unfortunately we have to
# do a lot of messing about with apt.
deps = []
src_records = apt_pkg.SourceRecords()
got_src = False
while src_records.lookup(version.source_name):
if pack in src_records.binaries:
got_src = True
break
if got_src:
# pylint: disable=E1101
for _, all_deps in src_records.build_depends.iteritems():
# pylint: enable=E1101
for or_deps in all_deps:
base_deps = []
for (name, ver, op) in or_deps:
base_deps.append(apt.package.BaseDependency(name, op,
ver, False))
deps.append(apt.package.Dependency(base_deps))
process_deps(cache, deps)
def usage(exit_code):
print 'Usage: %s <package name> [<distribution>]' % sys.argv[0]
sys.exit(exit_code)
def main():
global packages, distro
# Check if the amount of arguments is correct
if len(sys.argv) > 1 and sys.argv[1] in ('help', '-h', '--help'):
usage(0)
if len(sys.argv) < 2 or len(sys.argv) > 3:
usage(1)
cache = apt.cache.Cache()
if len(sys.argv) == 3 and sys.argv[2]:
distro = sys.argv[2]
if not get_package_version(cache, distro, 'bash'):
print u'«%s» is not a valid distribution.' % distro
print ('Remember that for 404main to work with a certain '
'distribution it must be in your /etc/apt/sources.list '
'file.')
sys.exit(1)
else:
cmd = ['lsb_release', '-cs']
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
distro = process.stdout.read().strip('\n')
if not get_package_version(cache, distro, sys.argv[1]):
print (u"Can't find package «%s» in distribution «%s»."
% (sys.argv[1], distro))
sys.exit(1)
print (u'Checking package «%s» in distribution «%s»...'
% (sys.argv[1], distro))
find_main(cache, sys.argv[1])
# True if everything checked until the point is in main
all_in_main = True
for package in packages:
if not packages[package]:
if all_in_main:
print 'The following packages aren\'t in main:'
all_in_main = False
print ' ', package
if all_in_main:
print (u'Package «%s» and all its dependencies and build dependencies '
u'are in main.') % sys.argv[1]
if __name__ == '__main__':
# Global variable to hold the status of all packages
packages = {}
# Global variable to hold the target distribution
distro = ''
try:
main()
except KeyboardInterrupt:
print 'Aborted.'
sys.exit(1)

View File

@ -1,12 +1,12 @@
Updating the ubuntu-dev-tools package
-------------------------------------
Here are the steps that are recommended to take when updating the
Here are the 10 steps that are recommended to take when updating the
ubuntu-dev-tools package in Ubuntu.
1) Make sure that there are no new revisions to the package's trunk in Bazaar:
1) Make sure there are no new commits to the package's master branch in git:
bzr pull lp:ubuntu-dev-tools
git pull
2) Check to make sure that all approved merges have been merged:
@ -15,6 +15,7 @@ ubuntu-dev-tools package in Ubuntu.
3) Make sure that there is no low lying fruit that can be fixed at:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools
https://bugs.debian.org/src:ubuntu-dev-tools
4) Check that the test suite passes
@ -27,31 +28,27 @@ ubuntu-dev-tools package in Ubuntu.
If there is no UNRELEASED entry, make sure that the version for the current
one has not been uploaded by someone else already:
http://packages.qa.debian.org/u/ubuntu-dev-tools.html
https://tracker.debian.org/pkg/ubuntu-dev-tools
https://launchpad.net/ubuntu/+source/ubuntu-dev-tools/+publishinghistory
6) Once the target release has been changed, commit it to Bazaar (where X.YY is
6) Once the target release has been changed, commit it to git (where X.YY is
the new package version):
bzr commit -m "Uploaded X.YY to RELEASE."
git commit -a -m "Uploaded X.YY to RELEASE."
7) Tag the new release in Bazaar:
7) Create the new source package and tag the new release in git:
bzr tag
gbp buildpackage -S --git-tag
For a full list of tags, please see: 'bzr tags'. This is so we can track
which Bazaar revision is in which release and makes bug triaging easier.
For a full list of tags, please see: 'git tag -l'. This is so we can track
which git commit is in which release and makes bug triaging easier.
8) Create the new source package:
bzr bd -S
9) Upload the package to Debian with dput as normal:
8) Upload the package to Debian with dput as normal:
dput ftp-master ubuntu-dev-tools_X.YY_$arch.changes
10) Create a new blank entry with dch -i and mark it as UNRELEASED.
9) Create a new blank entry with dch -i and mark it as UNRELEASED.
11) After it's been dinstalled in Debian, sync to Ubuntu:
10) After it's been dinstalled in Debian, sync to Ubuntu:
syncpackage ubuntu-dev-tools

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# ##################################################################
#
@ -18,228 +18,286 @@
#
# ##################################################################
import optparse
import argparse
import glob
import os
import shutil
import subprocess
import sys
import tempfile
from urllib.parse import quote
from launchpadlib.launchpad import Launchpad
import lsb_release
try:
import lsb_release
except ImportError:
lsb_release = None
from distro_info import DebianDistroInfo, UbuntuDistroInfo
from httplib2 import Http, HttpLib2Error
from debian.debian_support import Version
from devscripts.logger import Logger
from ubuntutools.archive import (SourcePackage, DebianSourcePackage,
UbuntuSourcePackage, DownloadError, rmadison)
from ubuntutools.config import UDTConfig, ubu_email
from ubuntutools import getLogger
from ubuntutools.archive import DebianSourcePackage, DownloadError, UbuntuSourcePackage
from ubuntutools.builder import get_builder
from ubuntutools.misc import (system_distribution, vendor_to_distroinfo,
codename_to_distribution)
from ubuntutools.config import UDTConfig, ubu_email
from ubuntutools.lp.lpapicache import (
Distribution,
Launchpad,
PackageNotFoundException,
SeriesNotFoundException,
)
from ubuntutools.misc import codename_to_distribution, system_distribution, vendor_to_distroinfo
from ubuntutools.question import YesNoQuestion
from ubuntutools import subprocess
def error(msg):
Logger.error(msg)
Logger = getLogger()
def error(msg, *args):
Logger.error(msg, *args)
sys.exit(1)
def check_call(cmd, *args, **kwargs):
Logger.command(cmd)
Logger.debug(" ".join(cmd))
ret = subprocess.call(cmd, *args, **kwargs)
if ret != 0:
error('%s returned %d.' % (cmd[0], ret))
error("%s returned %d.", cmd[0], ret)
def parse(args):
usage = 'Usage: %prog [options] <source package name or .dsc URL/file>'
parser = optparse.OptionParser(usage)
parser.add_option('-d', '--destination',
dest='dest_releases',
default=[],
action='append',
help='Backport to DEST release '
'(default: current release)',
metavar='DEST')
parser.add_option('-s', '--source',
dest='source_release',
default=None,
help='Backport from SOURCE release '
'(default: devel release)',
metavar='SOURCE')
parser.add_option('-S', '--suffix',
dest='suffix',
default=None,
help='Suffix to append to version number '
'(default: ~ppa1)',
metavar='SUFFIX')
parser.add_option('-b', '--build',
dest='build',
default=False,
action='store_true',
help='Build the package before uploading '
'(default: %default)')
parser.add_option('-B', '--builder',
dest='builder',
default=None,
help='Specify the package builder (default: pbuilder)',
metavar='BUILDER')
parser.add_option('-U', '--update',
dest='update',
default=False,
action='store_true',
help='Update the build environment before '
'attempting to build')
parser.add_option('-u', '--upload',
dest='upload',
help='Specify an upload destination',
metavar='UPLOAD')
parser.add_option('-y', '--yes',
dest='prompt',
default=True,
action='store_false',
help='Do not prompt before uploading to a PPA')
parser.add_option('-v', '--version',
dest='version',
default=None,
help='Package version to backport (or verify)',
metavar='VERSION')
parser.add_option('-w', '--workdir',
dest='workdir',
default=None,
help='Specify a working directory '
'(default: temporary dir)',
metavar='WORKDIR')
parser.add_option('-m', '--mirror',
dest='mirror',
default=None,
help='Preferred mirror (default: Launchpad)',
metavar='INSTANCE')
parser.add_option('-l', '--lpinstance',
dest='lpinstance',
default=None,
help='Launchpad instance to connect to '
'(default: production)',
metavar='INSTANCE')
parser.add_option('--no-conf',
dest='no_conf',
default=False,
help="Don't read config files or environment variables",
action='store_true')
opts, args = parser.parse_args(args)
if len(args) != 1:
parser.error('You must specify a single source package or a .dsc '
'URL/path.')
config = UDTConfig(opts.no_conf)
if opts.builder is None:
opts.builder = config.get_value('BUILDER')
if not opts.update:
opts.update = config.get_value('UPDATE_BUILDER', boolean=True)
if opts.workdir is None:
opts.workdir = config.get_value('WORKDIR')
if opts.lpinstance is None:
opts.lpinstance = config.get_value('LPINSTANCE')
if not opts.upload and not opts.workdir:
parser.error('Please specify either a working dir or an upload target!')
def parse(argv):
usage = "%(prog)s [options] <source package name or .dsc URL/file>"
parser = argparse.ArgumentParser(usage=usage)
parser.add_argument(
"-d",
"--destination",
metavar="DEST",
dest="dest_releases",
default=[],
action="append",
help="Backport to DEST release (default: current release)",
)
parser.add_argument(
"-s",
"--source",
metavar="SOURCE",
dest="source_release",
help="Backport from SOURCE release (default: devel release)",
)
parser.add_argument(
"-S",
"--suffix",
metavar="SUFFIX",
help="Suffix to append to version number (default: ~ppa1 when uploading to a PPA)",
)
parser.add_argument(
"-e",
"--message",
metavar="MESSAGE",
default="No-change",
help='Changelog message to use instead of "No-change" '
"(default: No-change backport to DEST.)",
)
parser.add_argument(
"-b",
"--build",
default=False,
action="store_true",
help="Build the package before uploading (default: %(default)s)",
)
parser.add_argument(
"-B",
"--builder",
metavar="BUILDER",
help="Specify the package builder (default: pbuilder)",
)
parser.add_argument(
"-U",
"--update",
default=False,
action="store_true",
help="Update the build environment before attempting to build",
)
parser.add_argument("-u", "--upload", metavar="UPLOAD", help="Specify an upload destination")
parser.add_argument(
"-k", "--key", dest="keyid", help="Specify the key ID to be used for signing."
)
parser.add_argument(
"--dont-sign", dest="keyid", action="store_false", help="Do not sign the upload."
)
parser.add_argument(
"-y",
"--yes",
dest="prompt",
default=True,
action="store_false",
help="Do not prompt before uploading to a PPA",
)
parser.add_argument(
"-v", "--version", metavar="VERSION", help="Package version to backport (or verify)"
)
parser.add_argument(
"-w",
"--workdir",
metavar="WORKDIR",
help="Specify a working directory (default: temporary dir)",
)
parser.add_argument(
"-r",
"--release-pocket",
default=False,
action="store_true",
help="Target the release pocket in the .changes file. "
"Necessary (and default) for uploads to PPAs",
)
parser.add_argument(
"-c", "--close", metavar="BUG", help="Bug to close in the changelog entry."
)
parser.add_argument(
"-m", "--mirror", metavar="URL", help="Preferred mirror (default: Launchpad)"
)
parser.add_argument(
"-l",
"--lpinstance",
metavar="INSTANCE",
help="Launchpad instance to connect to (default: production)",
)
parser.add_argument(
"--no-conf",
default=False,
action="store_true",
help="Don't read config files or environment variables",
)
parser.add_argument("package_or_dsc", help=argparse.SUPPRESS)
return opts, args, config
args = parser.parse_args(argv)
config = UDTConfig(args.no_conf)
if args.builder is None:
args.builder = config.get_value("BUILDER")
if not args.update:
args.update = config.get_value("UPDATE_BUILDER", boolean=True)
if args.workdir is None:
args.workdir = config.get_value("WORKDIR")
if args.lpinstance is None:
args.lpinstance = config.get_value("LPINSTANCE")
if args.upload is None:
args.upload = config.get_value("UPLOAD")
if args.keyid is None:
args.keyid = config.get_value("KEYID")
if not args.upload and not args.workdir:
parser.error("Please specify either a working dir or an upload target!")
if args.upload and args.upload.startswith("ppa:"):
args.release_pocket = True
def get_current_version(package, distribution, source_release):
info = vendor_to_distroinfo(distribution)
source_release = info().codename(source_release, default=source_release)
return args, config
latest_version = None
releases = [source_release]
if distribution.lower() == "ubuntu":
releases += [source_release + "-updates", source_release + "-security"]
for release in releases:
for record in rmadison(distribution.lower(), package, suite=release):
if 'source' not in record:
continue
if (not latest_version or
Version(latest_version) < Version(record['version'])):
latest_version = record['version']
return latest_version
def find_release_package(launchpad, mirror, workdir, package, version,
source_release, config):
def find_release_package(mirror, workdir, package, version, source_release, config):
srcpkg = None
if source_release:
distribution = codename_to_distribution(source_release)
if not distribution:
error('Unknown release codename %s' % source_release)
error("Unknown release codename %s", source_release)
info = vendor_to_distroinfo(distribution)()
source_release = info.codename(source_release, default=source_release)
else:
distribution = system_distribution()
mirrors = [mirror] if mirror else []
mirrors.append(config.get_value('%s_MIRROR' % distribution.upper()))
mirrors.append(config.get_value(f"{distribution.upper()}_MIRROR"))
if not version:
version = get_current_version(package, distribution, source_release)
archive = Distribution(distribution.lower()).getArchive()
try:
spph = archive.getSourcePackage(package, source_release)
except (SeriesNotFoundException, PackageNotFoundException) as e:
error("%s", str(e))
version = spph.getVersion()
if not version:
error('Unable to find package %s in release %s.' %
(package, source_release))
if distribution == 'Debian':
srcpkg = DebianSourcePackage(package,
version,
workdir=workdir,
lp=launchpad,
mirrors=mirrors)
elif distribution == 'Ubuntu':
srcpkg = UbuntuSourcePackage(package,
version,
workdir=workdir,
lp=launchpad,
mirrors=mirrors)
if distribution == "Debian":
srcpkg = DebianSourcePackage(package, version, workdir=workdir, mirrors=mirrors)
elif distribution == "Ubuntu":
srcpkg = UbuntuSourcePackage(package, version, workdir=workdir, mirrors=mirrors)
return srcpkg
def find_package(launchpad, mirror, workdir, package, version, source_release,
config):
def find_package(mirror, workdir, package, version, source_release, config):
"Returns the SourcePackage"
if package.endswith('.dsc'):
return SourcePackage(version=version, dscfile=package,
workdir=workdir, lp=launchpad,
mirrors=(mirror,))
if package.endswith(".dsc"):
# Here we are using UbuntuSourcePackage just because we don't have any
# "general" class that is safely instantiable (as SourcePackage is an
# abstract class). None of the distribution-specific details within
# UbuntuSourcePackage is relevant for this use case.
return UbuntuSourcePackage(
version=version, dscfile=package, workdir=workdir, mirrors=(mirror,)
)
if not source_release and not version:
info = vendor_to_distroinfo(system_distribution())
source_release = info().devel()
srcpkg = find_release_package(launchpad, mirror, workdir, package, version,
source_release, config)
srcpkg = find_release_package(mirror, workdir, package, version, source_release, config)
if version and srcpkg.version != version:
error('Requested backport of version %s but version of %s in %s is %s'
% (version, package, source_release, srcpkg.version))
error(
"Requested backport of version %s but version of %s in %s is %s",
version,
package,
source_release,
srcpkg.version,
)
return srcpkg
def get_backport_version(version, suffix, upload, release):
backport_version = version + ('~%s1' % release)
distribution = codename_to_distribution(release)
if not distribution:
error("Unknown release codename %s", release)
if distribution == "Debian":
debian_distro_info = DebianDistroInfo()
debian_codenames = debian_distro_info.supported()
if release in debian_codenames:
release_version = debian_distro_info.version(release)
if not release_version:
error("Can't find the release version for %s", release)
backport_version = f"{version}~bpo{release_version}+1"
else:
error("%s is not a supported release (%s)", release, debian_codenames)
elif distribution == "Ubuntu":
series = Distribution(distribution.lower()).getSeries(name_or_version=release)
backport_version = f"{version}~bpo{series.version}.1"
else:
error("Unknown distribution «%s» for release «%s»", distribution, release)
if suffix is not None:
backport_version += suffix
elif upload and upload.startswith('ppa:'):
backport_version += '~ppa1'
elif upload and upload.startswith("ppa:"):
backport_version += "~ppa1"
return backport_version
def get_backport_dist(upload, release):
if not upload or upload == 'ubuntu':
return '%s-backports' % release
else:
def get_old_version(source, release):
try:
distribution = codename_to_distribution(release)
archive = Distribution(distribution.lower()).getArchive()
pkg = archive.getSourcePackage(
source, release, ("Release", "Security", "Updates", "Proposed", "Backports")
)
return pkg.getVersion()
except (SeriesNotFoundException, PackageNotFoundException):
pass
return None
def get_backport_dist(release, release_pocket):
if release_pocket:
return release
return f"{release}-backports"
def do_build(workdir, dsc, release, builder, update):
builder = get_builder(builder)
if not builder:
return
return None
if update:
if 0 != builder.update(release):
@ -247,100 +305,191 @@ def do_build(workdir, dsc, release, builder, update):
# builder.build is going to chdir to buildresult:
workdir = os.path.realpath(workdir)
return builder.build(os.path.join(workdir, dsc),
release,
os.path.join(workdir, "buildresult"))
return builder.build(os.path.join(workdir, dsc), release, os.path.join(workdir, "buildresult"))
def do_upload(workdir, package, bp_version, changes, upload, prompt):
print 'Please check %s %s in file://%s carefully!' % \
(package, bp_version, workdir)
if prompt or upload == 'ubuntu':
question = 'Do you want to upload the package to %s' % upload
print(f"Please check {package} {bp_version} in file://{workdir} carefully!")
if prompt or upload == "ubuntu":
question = f"Do you want to upload the package to {upload}"
answer = YesNoQuestion().ask(question, "yes")
if answer == "no":
return
check_call(['dput', upload, changes], cwd=workdir)
check_call(["dput", upload, changes], cwd=workdir)
def do_backport(workdir, pkg, suffix, release, build, builder, update, upload,
prompt):
dirname = '%s-%s' % (pkg.source, release)
pkg.unpack(dirname)
def orig_needed(upload, workdir, pkg):
"""Avoid a -sa if possible"""
if not upload or not upload.startswith("ppa:"):
return True
ppa = upload.split(":", 1)[1]
user, ppa = ppa.split("/", 1)
version = pkg.version.upstream_version
http = Http()
for filename in glob.glob(os.path.join(workdir, f"{pkg.source}_{version}.orig*")):
url = (
f"https://launchpad.net/~{quote(user)}/+archive/{quote(ppa)}/+sourcefiles"
f"/{quote(pkg.source)}/{quote(pkg.version.full_version)}"
f"/{quote(os.path.basename(filename))}"
)
try:
headers = http.request(url, "HEAD")[0]
if headers.status != 200 or not headers["content-location"].startswith(
"https://launchpadlibrarian.net"
):
return True
except HttpLib2Error as e:
Logger.debug(e)
return True
return False
def do_backport(
workdir,
pkg,
suffix,
message,
close,
release,
release_pocket,
build,
builder,
update,
upload,
keyid,
prompt,
):
dirname = f"{pkg.source}-{release}"
srcdir = os.path.join(workdir, dirname)
bp_version = get_backport_version(pkg.version.full_version, suffix,
upload, release)
bp_dist = get_backport_dist(upload, release)
if os.path.exists(srcdir):
question = f"Working directory {srcdir} already exists. Delete it?"
if YesNoQuestion().ask(question, "no") == "no":
sys.exit(1)
shutil.rmtree(srcdir)
check_call(['dch',
'--force-bad-version',
'--force-distribution',
'--preserve',
'--newversion', bp_version,
'--distribution', bp_dist,
'No-change backport to %s' % release],
cwd=srcdir)
check_call(['debuild', '--no-lintian', '-S', '-sa'], cwd=srcdir)
pkg.unpack(dirname)
fn_base = pkg.source + '_' + bp_version.split(':', 1)[-1]
bp_version = get_backport_version(pkg.version.full_version, suffix, upload, release)
old_version = get_old_version(pkg.source, release)
bp_dist = get_backport_dist(release, release_pocket)
changelog = f"{message} backport to {release}."
if close:
changelog += f" (LP: #{close})"
check_call(
[
"dch",
"--force-bad-version",
"--force-distribution",
"--preserve",
"--newversion",
bp_version,
"--distribution",
bp_dist,
changelog,
],
cwd=srcdir,
)
cmd = ["debuild", "--no-lintian", "-S", "-nc", "-uc", "-us"]
if orig_needed(upload, workdir, pkg):
cmd.append("-sa")
else:
cmd.append("-sd")
if old_version:
cmd.append(f"-v{old_version}")
env = os.environ.copy()
# An ubuntu.com e-mail address would make dpkg-buildpackage fail if there
# wasn't an Ubuntu maintainer for an ubuntu-versioned package. LP: #1007042
env.pop("DEBEMAIL", None)
check_call(cmd, cwd=srcdir, env=env)
fn_base = pkg.source + "_" + bp_version.split(":", 1)[-1]
changes = fn_base + "_source.changes"
if build:
if 0 != do_build(workdir, fn_base + '.dsc', release, builder, update):
if 0 != do_build(workdir, fn_base + ".dsc", release, builder, update):
sys.exit(1)
# None: sign with the default signature. False: don't sign
if keyid is not False:
cmd = ["debsign"]
if keyid:
cmd.append("-k" + keyid)
cmd.append(changes)
check_call(cmd, cwd=workdir)
if upload:
do_upload(workdir, pkg.source, bp_version, fn_base + '_source.changes',
upload, prompt)
do_upload(workdir, pkg.source, bp_version, changes, upload, prompt)
shutil.rmtree(srcdir)
def main(args):
def main(argv):
ubu_email()
opts, (package_or_dsc,), config = parse(args[1:])
args, config = parse(argv[1:])
script_name = os.path.basename(sys.argv[0])
launchpad = Launchpad.login_anonymously(script_name, opts.lpinstance)
Launchpad.login_anonymously(service=args.lpinstance)
if not opts.dest_releases:
distinfo = lsb_release.get_distro_information()
try:
opts.dest_releases = [distinfo['CODENAME']]
except KeyError:
error('No destination release specified and unable to guess yours.')
if not args.dest_releases:
if lsb_release:
distinfo = lsb_release.get_distro_information()
try:
current_distro = distinfo["ID"]
except KeyError:
error("No destination release specified and unable to guess yours.")
else:
err, current_distro = subprocess.getstatusoutput("lsb_release --id --short")
if err:
error("Could not run lsb_release to retrieve distribution")
if opts.workdir:
workdir = os.path.expanduser(opts.workdir)
if current_distro == "Ubuntu":
args.dest_releases = [UbuntuDistroInfo().lts()]
elif current_distro == "Debian":
args.dest_releases = [DebianDistroInfo().stable()]
else:
error("Unknown distribution %s, can't guess target release", current_distro)
if args.workdir:
workdir = os.path.expanduser(args.workdir)
else:
workdir = tempfile.mkdtemp(prefix='backportpackage-')
workdir = tempfile.mkdtemp(prefix="backportpackage-")
if not os.path.exists(workdir):
os.makedirs(workdir)
try:
pkg = find_package(launchpad,
opts.mirror,
workdir,
package_or_dsc,
opts.version,
opts.source_release,
config)
pkg = find_package(
args.mirror, workdir, args.package_or_dsc, args.version, args.source_release, config
)
pkg.pull()
for release in opts.dest_releases:
do_backport(workdir,
pkg,
opts.suffix,
release,
opts.build,
opts.builder,
opts.update,
opts.upload,
opts.prompt)
except DownloadError, e:
error(str(e))
for release in args.dest_releases:
do_backport(
workdir,
pkg,
args.suffix,
args.message,
args.close,
release,
args.release_pocket,
args.build,
args.builder,
args.update,
args.upload,
args.keyid,
args.prompt,
)
except DownloadError as e:
error("%s", str(e))
finally:
if not opts.workdir:
if not args.workdir:
shutil.rmtree(workdir)
if __name__ == '__main__':
if __name__ == "__main__":
sys.exit(main(sys.argv))

View File

@ -21,7 +21,7 @@ _pbuilder-dist()
case $prev in
build)
COMPREPLY=( $( compgen -o filenames -G "$cur*.dsc" ) )
_filedir "dsc"
;;
*)
COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
@ -36,7 +36,7 @@ _pbuilder-dist()
for distro in $(ubuntu-distro-info --all; debian-distro-info --all) stable testing unstable; do
for builder in pbuilder cowbuilder; do
echo "$builder-$distro"
for arch in i386 amd64 armel; do
for arch in i386 amd64 armhf; do
echo "$builder-$distro-$arch"
done
done

View File

@ -1,89 +0,0 @@
#!/usr/bin/python
"""Add 'bitesize' tag to bugs and add a comment."""
# Copyright (c) 2011 Canonical Ltd.
#
# bitesize is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# bitesize is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with bitesize; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# Authors:
# Daniel Holbach <daniel.holbach@canonical.com>
import sys
from optparse import OptionParser
from launchpadlib.launchpad import Launchpad
from launchpadlib.errors import HTTPError
from devscripts.logger import Logger
from ubuntutools.config import UDTConfig
def error_out(msg):
Logger.error(msg)
sys.exit(1)
def save_entry(entry):
try:
entry.lp_save()
except HTTPError, error:
error_out(error.content)
def tag_bug(bug):
bug.tags = bug.tags + ['bitesize'] # LP: #254901 workaround
save_entry(bug)
def main():
usage = "Usage: %prog <bug number>"
opt_parser = OptionParser(usage)
opt_parser.add_option("-l", "--lpinstance", metavar="INSTANCE",
help="Launchpad instance to connect to "
"(default: production)",
dest="lpinstance", default=None)
opt_parser.add_option("--no-conf",
help="Don't read config files or "
"environment variables.",
dest="no_conf", default=False, action="store_true")
(options, args) = opt_parser.parse_args()
config = UDTConfig(options.no_conf)
if options.lpinstance is None:
options.lpinstance = config.get_value("LPINSTANCE")
if len(args) < 1:
opt_parser.error("Need at least one bug number.")
launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
if launchpad is None:
error_out("Couldn't authenticate to Launchpad.")
# check that the new main bug isn't a duplicate
try:
bug = launchpad.bugs[args[0]]
except HTTPError, error:
if error.response.status == 401:
error_out("Don't have enough permissions to access bug %s. %s" % \
(args[0], error.content))
else:
raise
if 'bitesize' in bug.tags:
error_out("Bug is already marked as 'bitesize'.")
bug.newMessage(content="I'm marking this bug as 'bitesize' as it looks "
"like an issue that is easy to fix and suitable "
"for newcomers in Ubuntu development. If you need "
"any help with fixing it, talk to me about it.")
bug.subscribe(person=launchpad.me)
tag_bug(launchpad.bugs[bug.id]) # fresh bug object, LP: #336866 workaround
if __name__ == '__main__':
main()

144
check-mir
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# Check components of build dependencies and warn about universe/multiverse
# ones, for a package destined for main/restricted
@ -21,65 +21,116 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import apt
import sys
# pylint: disable=invalid-name
# pylint: enable=invalid-name
"""Check if any of a package's build or binary dependencies are in universe or multiverse.
Run this inside an unpacked source package
"""
import argparse
import os.path
import sys
import apt
def check_support(apt_cache, pkgname, alt=False):
'''Check if pkgname is in main or restricted.
"""Check if pkgname is in main or restricted.
This prints messages if a package is not in main/restricted, or only
partially (i. e. source in main, but binary in universe).
'''
"""
if alt:
prefix = ' ... alternative ' + pkgname
prefix = " ... alternative " + pkgname
else:
prefix = ' * ' + pkgname
prefix = " * " + pkgname
try:
prov_packages = apt_cache.get_providing_packages(pkgname)
if pkgname in apt_cache:
pkg = apt_cache[pkgname]
except KeyError:
print >> sys.stderr, prefix, 'does not exist (pure virtual?)'
# If this is a virtual package, iterate through the binary packages that
# provide this, and ensure they are all in Main. Source packages in and of
# themselves cannot provide virtual packages, only binary packages can.
elif len(prov_packages) > 0:
supported, unsupported = [], []
for pkg in prov_packages:
candidate = pkg.candidate
if candidate:
section = candidate.section
if section.startswith("universe") or section.startswith("multiverse"):
unsupported.append(pkg.name)
else:
supported.append(pkg.name)
if len(supported) > 0:
msg = "is a virtual package, which is provided by the following "
msg += "candidates in Main: " + " ".join(supported)
print(prefix, msg)
elif len(unsupported) > 0:
msg = "is a virtual package, but is only provided by the "
msg += "following non-Main candidates: " + " ".join(unsupported)
print(prefix, msg, file=sys.stderr)
return False
else:
msg = "is a virtual package that exists but is not provided by "
msg += "package currently in the archive. Proceed with caution."
print(prefix, msg, file=sys.stderr)
return False
else:
print(prefix, "does not exist", file=sys.stderr)
return False
section = pkg.candidate.section
if section.startswith('universe') or section.startswith('multiverse'):
if section.startswith("universe") or section.startswith("multiverse"):
# check if the source package is in main and thus will only need binary
# promotion
source_records = apt.apt_pkg.SourceRecords()
if not source_records.lookup(pkg.candidate.source_name):
print >> sys.stderr, 'ERROR: Cannot lookup source package for', \
pkg.name
print prefix, 'package is in', section.split('/')[0]
print("ERROR: Cannot lookup source package for", pkg.name, file=sys.stderr)
print(prefix, "package is in", section.split("/")[0])
return False
src = apt.apt_pkg.TagSection(source_records.record)
if (src['Section'].startswith('universe') or
src['Section'].startswith('multiverse')):
print prefix, 'binary and source package is in', \
section.split('/')[0]
if src["Section"].startswith("universe") or src["Section"].startswith("multiverse"):
print(prefix, "binary and source package is in", section.split("/")[0])
return False
else:
print prefix, 'is in', section.split('/')[0] + ', but its source', \
pkg.candidate.source_name, \
('is already in main; file an ubuntu-archive bug for '
'promoting the current preferred alternative')
return True
print(
prefix,
"is in",
section.split("/")[0] + ", but its source",
pkg.candidate.source_name,
"is already in main; file an ubuntu-archive bug for "
"promoting the current preferred alternative",
)
return True
if alt:
print prefix, 'is already in main; consider preferring it'
print(prefix, "is already in main; consider preferring it")
return True
def check_build_dependencies(apt_cache, control):
print 'Checking support status of build dependencies...'
print("Checking support status of build dependencies...")
any_unsupported = False
for field in ('Build-Depends', 'Build-Depends-Indep'):
for field in ("Build-Depends", "Build-Depends-Indep"):
if field not in control.section:
continue
for or_group in apt.apt_pkg.parse_src_depends(control.section[field]):
pkgname = or_group[0][0]
# debhelper-compat is expected to be a build dependency of every
# package, so it is a red herring to display it in this report.
# (src:debhelper is in Ubuntu Main anyway)
if pkgname == "debhelper-compat":
continue
if not check_support(apt_cache, pkgname):
# check non-preferred alternatives
for altpkg in or_group[1:]:
@ -90,22 +141,23 @@ def check_build_dependencies(apt_cache, control):
return any_unsupported
def check_binary_dependencies(apt_cache, control):
any_unsupported = False
print '\nChecking support status of binary dependencies...'
print("\nChecking support status of binary dependencies...")
while True:
try:
control.next()
next(control)
except StopIteration:
break
for field in ('Depends', 'Pre-Depends', 'Recommends'):
for field in ("Depends", "Pre-Depends", "Recommends"):
if field not in control.section:
continue
for or_group in apt.apt_pkg.parse_depends(control.section[field]):
for or_group in apt.apt_pkg.parse_src_depends(control.section[field]):
pkgname = or_group[0][0]
if pkgname.startswith('$'):
if pkgname.startswith("$"):
continue
if not check_support(apt_cache, pkgname):
# check non-preferred alternatives
@ -117,27 +169,35 @@ def check_binary_dependencies(apt_cache, control):
return any_unsupported
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.parse_args()
apt_cache = apt.Cache()
if not os.path.exists('debian/control'):
print >> sys.stderr, ('debian/control not found. You need to run '
'this tool in a source package directory')
if not os.path.exists("debian/control"):
print(
"debian/control not found. You need to run this tool in a source package directory",
file=sys.stderr,
)
sys.exit(1)
# get build dependencies from debian/control
control = apt.apt_pkg.TagFile(open('debian/control'))
control.next()
control = apt.apt_pkg.TagFile(open("debian/control", encoding="utf-8"))
next(control)
unsupported_build_deps = check_build_dependencies(apt_cache, control)
unsupported_binary_deps = check_binary_dependencies(apt_cache, control)
if unsupported_build_deps or unsupported_binary_deps:
print ('\nPlease check https://wiki.ubuntu.com/MainInclusionProcess if '
'this source package needs to get into in main/restricted, or '
'reconsider if the package really needs above dependencies.')
print(
"\nPlease check https://wiki.ubuntu.com/MainInclusionProcess if "
"this source package needs to get into in main/restricted, or "
"reconsider if the package really needs above dependencies."
)
else:
print 'All dependencies are supported in main or restricted.'
print("All dependencies are supported in main or restricted.")
if __name__ == '__main__':
if __name__ == "__main__":
main()

View File

@ -29,21 +29,55 @@
# * nm (from binutils)
DISTRO=$(lsb_release -c -s)
VERSION=$(apt-cache madison "$1" | grep -- "$DISTRO"'/.*Sources$' | awk '{print $3}')
PACKAGES=$(apt-cache showsrc "$1" | grep-dctrl -s Binary -F Version "$VERSION" | sed 's/Binary\:\ //g;s/\,//g' | sort -u)
DEBLINE=""
DEBUG=False
if [[ -z $1 ]]; then
echo "Missing argument: source package name."
exit 1
usage() {
prog=$(basename $0)
cat <<EOF
Usage: $prog [options] source-package [DEBDIR]
Get a diff of the exported symbols of all .so files in every binary package of
package the source package. The source package will be found in DEBDIR, defaulting to /var/cache/pbuilder/result.
Options:
-h, --help show this help message and exit
EOF
exit $1
}
PACKAGE=""
DEBDIR="/var/cache/pbuilder/result"
POSITION=0
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
usage 0
;;
-*)
usage 1
;;
*)
if [ $POSITION -eq 0 ]; then
PACKAGE="$1"
elif [ $POSITION -eq 1 ]; then
DEBDIR="$1"
else
echo "Too many arguments." >&2
usage 1
fi
POSITION=$(($POSITION+1))
esac
shift
done
if [ $POSITION -eq 0 ]; then
echo "Missing argument: source package name." >&2
usage 1
fi
if [[ -z $2 ]]; then
DEBDIR="/var/cache/pbuilder/result"
else
DEBDIR="$2"
fi
VERSION=$(apt-cache madison "$PACKAGE" | grep -- "$DISTRO"'/.*Sources$' | awk '{print $3}')
PACKAGES=$(apt-cache showsrc "$PACKAGE" | grep-dctrl -s Binary -F Version "$VERSION" | sed 's/Binary\:\ //g;s/\,//g' | sort -u)
if [ `id -u` != "0" ]
then
@ -67,7 +101,7 @@ do
done
if [[ -z $DEBLINE ]]; then
echo "Package doesn't exist: $1."
echo "Package doesn't exist: $PACKAGE."
exit 1
fi

1
debian/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
files

7
debian/NEWS vendored
View File

@ -1,3 +1,10 @@
ubuntu-dev-tools (0.135) unstable; urgency=low
reverse-build-depends was removed from ubuntu-dev-tools. reverse-depends -b
is equivalent.
-- Stefano Rivera <stefanor@debian.org> Sat, 12 Nov 2011 13:11:21 +0200
ubuntu-dev-tools (0.131) unstable; urgency=low
get-build-deps was removed from ubuntu-dev-tools. The newer mk-build-deps in

26
debian/README.source vendored Normal file
View File

@ -0,0 +1,26 @@
Changelog generation and releasing
----------------------------------
The changelog is generated by the uploader using `gbp dch' from
`git-buildpackage'. To invoke, just run
$ gbp dch
and then edit the changelog as appropriate - wrap lines, remove Signed-Off-By,
and so on. Then finalise the changelog, e.g.
$ dch -D unstable --release ""
commit it
$ git commit debian/changelog -m "Releasing 0.foo"
and tag/sign this commit
$ gbp buildpackage --git-tag-only
then build using (for example)
$ gbp buildpackage -S
and test/upload as normal.

1386
debian/changelog vendored

File diff suppressed because it is too large Load Diff

3
debian/clean vendored
View File

@ -1,2 +1 @@
*.egg-info/*
test-data/example_*
*.egg-info/

1
debian/compat vendored
View File

@ -1 +0,0 @@
7

179
debian/control vendored
View File

@ -1,85 +1,101 @@
Source: ubuntu-dev-tools
Section: devel
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-dev-team@lists.alioth.debian.org>
Uploaders: Benjamin Drung <bdrung@debian.org>,
Stefano Rivera <stefanor@debian.org>
Vcs-Bzr: lp:ubuntu-dev-tools
Vcs-Browser: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk
Build-Depends: dctrl-tools,
debhelper (>= 7.0.50~),
devscripts (>= 2.11.0~),
distro-info (>= 0.2~),
libwww-perl,
lsb-release,
pylint,
python-all (>= 2.6.5-13~),
python-apt (>= 0.7.93~),
python-debian (>= 0.1.20~),
python-distro-info (>= 0.4~),
python-gnupginterface,
python-launchpadlib (>= 1.5.7),
python-mox,
python-setuptools,
python-soappy,
python-unittest2
X-Python-Version: >= 2.6
Maintainer: Ubuntu Developers <ubuntu-dev-tools@packages.debian.org>
Uploaders:
Benjamin Drung <bdrung@debian.org>,
Stefano Rivera <stefanor@debian.org>,
Mattia Rizzolo <mattia@debian.org>,
Simon Quigley <tsimonq2@debian.org>,
Build-Depends:
black <!nocheck>,
dctrl-tools,
debhelper-compat (= 13),
devscripts (>= 2.11.0~),
dh-make,
dh-python,
distro-info (>= 0.2~),
flake8,
isort <!nocheck>,
lsb-release,
pylint <!nocheck>,
python3-all,
python3-apt,
python3-dateutil,
python3-debian,
python3-debianbts,
python3-distro-info,
python3-httplib2,
python3-launchpadlib-desktop,
python3-pytest,
python3-requests <!nocheck>,
python3-setuptools,
python3-yaml <!nocheck>,
Standards-Version: 4.7.2
Rules-Requires-Root: no
Vcs-Git: https://git.launchpad.net/ubuntu-dev-tools
Vcs-Browser: https://git.launchpad.net/ubuntu-dev-tools
Homepage: https://launchpad.net/ubuntu-dev-tools
Standards-Version: 3.9.2
Package: ubuntu-dev-tools
Architecture: all
Depends: binutils,
dctrl-tools,
devscripts (>= 2.11.0~),
diffstat,
distro-info (>= 0.2~),
dpkg-dev,
lsb-release,
python-apt (>= 0.7.93~),
python-debian (>= 0.1.20~),
python-distro-info (>= 0.4~),
python-launchpadlib (>= 1.5.7),
python-lazr.restfulclient,
sudo,
${misc:Depends},
${perl:Depends},
${python:Depends}
Recommends: bzr,
bzr-builddeb,
ca-certificates,
debian-archive-keyring,
debian-keyring,
debootstrap,
genisoimage,
libwww-perl,
pbuilder | cowdancer | sbuild,
perl-modules,
python-dns,
python-gnupginterface,
python-soappy,
reportbug (>= 3.39ubuntu1)
Suggests: ipython, python-simplejson | python (>= 2.7), qemu-user-static
Depends:
binutils,
dctrl-tools,
devscripts (>= 2.11.0~),
diffstat,
distro-info (>= 0.2~),
dpkg-dev,
dput,
lsb-release,
python3,
python3-apt,
python3-debian,
python3-debianbts,
python3-distro-info,
python3-httplib2,
python3-launchpadlib-desktop,
python3-lazr.restfulclient,
python3-ubuntutools (= ${binary:Version}),
python3-yaml,
sensible-utils,
sudo,
tzdata,
${misc:Depends},
${perl:Depends},
Recommends:
arch-test,
ca-certificates,
debian-archive-keyring,
debian-keyring,
debootstrap,
genisoimage,
lintian,
patch,
sbuild | pbuilder | cowbuilder,
python3-dns,
quilt,
reportbug (>= 3.39ubuntu1),
ubuntu-keyring | ubuntu-archive-keyring,
Suggests:
bzr | brz,
bzr-builddeb | brz-debian,
qemu-user-static,
Description: useful tools for Ubuntu developers
This is a collection of useful tools that Ubuntu developers use to make their
packaging work a lot easier.
.
Such tools include:
.
- 404main - used to check what components a package's deps are in, for
doing a main inclusion report for example.
- backportpackage - helper to test package backports
- bitesize - add the 'bitesize' tag to a bug and comment that you are
willing to help fix it.
- check-mir - check support status of build/binary dependencies
- check-symbols - will compare and give you a diff of the exported symbols of
all .so files in a binary package.
- dch-repeat - used to repeat a change log into an older release.
- dgetlp - download a source package from the Launchpad library.
- grab-merge - grabs a merge from merges.ubuntu.com easily.
- grep-merges - search for pending merges from Debian.
- harvest - grabs information about development opportunities from
http://harvest.ubuntu.com
- hugdaylist - compile HugDay lists from bug list URLs.
- import-bug-from-debian - copy a bug from the Debian BTS to Launchpad
- merge-changelog - manually merges two Debian changelogs with the same base
version.
@ -89,13 +105,22 @@ Description: useful tools for Ubuntu developers
chroots (for different Ubuntu and Debian releases) on the same system.
- pull-debian-debdiff - attempts to find and download a specific version of
a Debian package and its immediate parent to generate a debdiff.
- pull-debian-source - downloads the lastest source package available in
- pull-debian-source - downloads the latest source package available in
Debian of a package.
- pull-lp-source - downloads lastest source package from Launchpad.
- pull-revu-source - downloads the latest source package from REVU
- pull-lp-source - downloads source package from Launchpad.
- pull-lp-debs - downloads debs package(s) from Launchpad.
- pull-lp-ddebs - downloads dbgsym/ddebs package(s) from Launchpad.
- pull-lp-udebs - downloads udebs package(s) from Launchpad.
- pull-debian-* - same as pull-lp-* but for Debian packages.
- pull-uca-* - same as pull-lp-* but for Ubuntu Cloud Archive packages.
- pull-pkg - common script that provides above pull-* functionality.
- requestbackport - file a backporting request.
- requestsync - files a sync request with Debian changelog and rationale.
- reverse-build-depends - find the reverse build dependencies that a package
has.
- reverse-depends - find the reverse dependencies (or build dependencies) of
a package.
- running-autopkgtests - lists the currently running and/or queued
autopkgtests on the Ubuntu autopkgtest infrastructure
- seeded-in-ubuntu - query if a package is safe to upload during a freeze.
- setup-packaging-environment - assistant to get an Ubuntu installation
ready for packaging work.
- sponsor-patch - Downloads a patch from a Launchpad bug, patches the source
@ -105,4 +130,26 @@ Description: useful tools for Ubuntu developers
- ubuntu-build - give commands to the Launchpad build daemons from the
command line.
- ubuntu-iso - output information of an Ubuntu ISO image.
- ubuntu-upload-permission - query / list the upload permissions for a
package.
- update-maintainer - script to update maintainer field in ubuntu packages.
Package: python3-ubuntutools
Architecture: all
Section: python
Depends:
python3-dateutil,
python3-debian,
python3-distro-info,
python3-httplib2,
python3-launchpadlib-desktop,
python3-lazr.restfulclient,
python3-requests,
sensible-utils,
${misc:Depends},
${python3:Depends},
Description: useful APIs for Ubuntu developer tools — Python 3 library
This package ships a collection of APIs, helpers and wrappers used to
develop useful utilities for Ubuntu developers.
.
This package installs the library for Python 3.

89
debian/copyright vendored
View File

@ -1,29 +1,32 @@
Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Ubuntu Developer Tools
Upstream-Contact: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Source: https://launchpad.net/ubuntu-dev-tools
Files: *
backportpackage
Files: backportpackage
bash_completion/pbuilder-dist
check-symbols
debian/*
doc/backportpackage.1
doc/check-symbols.1
doc/requestsync.1
doc/ubuntu-iso.1
doc/running-autopkgtests.1
GPL-2
README.updates
requestsync
setup.py
TODO
ubuntu-iso
ubuntutools/requestsync/common.py
ubuntutools/requestsync/lp.py
ubuntutools/requestsync/mail.py
ubuntutools/requestsync/*.py
Copyright: 2007, Albert Damen <albrt@gmx.net>
2010, Benjamin Drung <bdrung@ubuntu.com>
2007-2010, Canonical Ltd.
2010-2024, Benjamin Drung <bdrung@ubuntu.com>
2007-2023, Canonical Ltd.
2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com>
2010, Evan Broder <evan@ebroder.net>
2006-2007, Luke Yelavich <themuso@ubuntu.com>
2009-2010, Michael Bienia <geser@ubuntu.com>
2024-2025, Simon Quigley <tsimonq2@debian.org>
2010-2011, Stefano Rivera <stefanor@ubuntu.com>
2008, Stephan Hermann <sh@sourcecode.de>
2007, Steve Kowalik <stevenk@ubuntu.com>
@ -40,25 +43,18 @@ License: GPL-2
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in the /usr/share/common-licenses/GPL-2 file.
Files: 404main
dgetlp
doc/404main.1
doc/dgetlp.1
doc/import-bug-from-debian.1
Files: doc/import-bug-from-debian.1
doc/pbuilder-dist-simple.1
doc/pbuilder-dist.1
doc/reverse-build-depends.1
doc/submittodebian.1
import-bug-from-debian
pbuilder-dist
pbuilder-dist-simple
reverse-build-depends
submittodebian
Copyright: 2007-2010, Canonical Ltd.
2009, James Westby <james.westby@ubuntu.com>
2008, Jamin W. Collins <jcollins@asgardsrealm.net>
2008, Jordan Mantha <mantha@ubuntu.com>
2008-2009, Patrick Schoenfeld <schoenfeld@in-medias-res.com>
2006-2007, Pete Savage <petesavage@ubuntu.com>
2009, Ryan Kavanagh <ryanakca@kubuntu.org>
2007, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
@ -78,23 +74,28 @@ License: GPL-2+
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in the /usr/share/common-licenses/GPL-2 file.
Files: doc/bitesize.1
Files: doc/lp-bitesize.1
doc/check-mir.1
doc/grab-merge.1
doc/harvest.1
doc/hugdaylist.1
doc/merge-changelog.1
doc/pm-helper.1
doc/setup-packaging-environment.1
doc/syncpackage.1
bitesize
lp-bitesize
check-mir
GPL-3
grab-merge
harvest
hugdaylist
merge-changelog
pm-helper
pyproject.toml
run-linters
running-autopkgtests
setup-packaging-environment
syncpackage
ubuntutools/harvest.py
Copyright: 2010, Benjamin Drung <bdrung@ubuntu.com>
2007-2011, Canonical Ltd.
ubuntutools/running_autopkgtests.py
ubuntutools/utils.py
Copyright: 2010-2024, Benjamin Drung <bdrung@ubuntu.com>
2007-2024, Canonical Ltd.
2008, Jonathan Patrick Davies <jpds@ubuntu.com>
2008-2010, Martin Pitt <martin.pitt@canonical.com>
2009, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
@ -116,17 +117,23 @@ Files: dch-repeat
doc/dch-repeat.1
doc/grep-merges.1
doc/mk-sbuild.1
doc/pull-lp-source.1
doc/pull-revu-source.1
doc/pull-pkg.1
doc/ubuntu-build.1
grep-merges
mk-sbuild
pull-lp-source
pull-revu-source
pull-pkg
pull-*debs
pull-*-source
requirements.txt
test-requirements.txt
tox.ini
ubuntu-build
ubuntutools/lp/libsupport.py
ubuntutools/__init__.py
ubuntutools/lp/__init__.py
ubuntutools/lp/lpapicache.py
ubuntutools/lp/udtexceptions.py
ubuntutools/misc.py
ubuntutools/pullpkg.py
Copyright: 2007-2010, Canonical Ltd.
2008-2009, Iain Lane <iain@orangesquash.org.uk>
2006, John Dong <jdong@ubuntu.com>
@ -135,7 +142,8 @@ Copyright: 2007-2010, Canonical Ltd.
2009-2010, Michael Bienia <geser@ubuntu.com>
2009, Nathan Handler <nhandler@ubuntu.com>
2007-2008, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
2010-2011, Stefano Rivera <stefanor@ubuntu.com>
2010-2012, Stefano Rivera <stefanor@ubuntu.com>
2012, Steve Langasek <steve.langasek@ubuntu.com>
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -151,26 +159,37 @@ License: GPL-3+
version 3 can be found in the /usr/share/common-licenses/GPL-3 file.
Files: doc/pull-debian-debdiff.1
doc/pull-debian-source.1
doc/requestbackport.1
doc/reverse-depends.1
doc/seeded-in-ubuntu.1
doc/sponsor-patch.1
doc/ubuntu-dev-tools.5
doc/ubuntu-upload-permission.1
doc/update-maintainer.1
enforced-editing-wrapper
pull-debian-debdiff
pull-debian-source
requestbackport
reverse-depends
seeded-in-ubuntu
sponsor-patch
test-data/*
ubuntu-upload-permission
ubuntutools/archive.py
ubuntutools/builder.py
ubuntutools/config.py
ubuntutools/question.py
ubuntutools/rdepends.py
ubuntutools/sponsor_patch/*
ubuntutools/test/*
ubuntutools/update_maintainer.py
ubuntutools/version.py
update-maintainer
Copyright: 2009-2011, Benjamin Drung <bdrung@ubuntu.com>
.pylintrc
Copyright: 2009-2024, Benjamin Drung <bdrung@ubuntu.com>
2010, Evan Broder <evan@ebroder.net>
2008, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
2010-2011, Stefano Rivera <stefanor@ubuntu.com>
2017-2021, Dan Streetman <ddstreet@canonical.com>
2024, Canonical Ltd.
License: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above

9
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,9 @@
[DEFAULT]
debian-tag = %(version)s
debian-branch = master
sign-tags = True
[dch]
meta = True
auto = True
full = True

1
debian/python3-ubuntutools.install vendored Normal file
View File

@ -0,0 +1 @@
/usr/lib/python3.*

16
debian/rules vendored
View File

@ -1,12 +1,14 @@
#!/usr/bin/make -f
%:
dh $@ --with python2
override_dh_auto_clean:
dh_auto_clean
rm -f .coverage
rm -rf .tox
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
set -e; \
for python in $(shell pyversions -r); do \
$$python setup.py test; \
done
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
python3 -m pytest -v ubuntutools
endif
%:
dh $@ --with python3 --buildsystem=pybuild

3
debian/source/lintian-overrides vendored Normal file
View File

@ -0,0 +1,3 @@
# pyc files are machine-generated; they're expected to have long lines and have unstated copyright
source: file-without-copyright-information *.pyc [debian/copyright]
source: very-long-line-length-in-source-file * > 512 [*.pyc:*]

7
debian/tests/control vendored Normal file
View File

@ -0,0 +1,7 @@
Test-Command: python3 -m pytest -v ubuntutools
Depends:
dh-make,
python3-pytest,
python3-setuptools,
@,
Restrictions: allow-stderr

2
debian/ubuntu-dev-tools.install vendored Normal file
View File

@ -0,0 +1,2 @@
/usr/bin
/usr/share

332
dgetlp
View File

@ -1,332 +0,0 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright (C) 2008 Terence Simpson <tsimpson@ubuntu.com>
# License:
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# This script simulates «dget»'s behaviour for files hosted at
# launchpadlibrarian.net.
#
# Detailed description:
# This script attempts to download the source package in the same
# way as dget does, but from launchpadlibrarian.net, which doesn't
# store all the files in the same directory. It (the script) assumes
# that the files are stored in sequential directories on Launchpad
# Librarian and attempts to download and then unpack them.
# This is a Python rewrite of the original bash script
import cStringIO
import email.feedparser
import hashlib
import optparse
import os
import sys
import urllib2
try:
import GnuPGInterface
except ImportError:
print >> sys.stderr, ("Please install 'python-gnupginterface' in order to "
"use this utility.")
sys.exit(1)
from ubuntutools import subprocess
USAGE = u"""Usage: %prog [-d|(-v|-q)] <Launchpad URL>
This scripts simulates «dget»'s behaviour for files hosted at
launchpadlibrarian.net.
If you specify the -d option then it won't do anything, except download the
.dsc file, but just print the commands it would run otherwise.
Example:
%prog http://launchpadlibrarian.net/10348157/coreutils_5.97-5.4ubuntu1.dsc
"""
BASE_URL = "http://launchpadlibrarian.net/"
Debug = Verbose = Quiet = False
def unsign(data):
if data.splitlines()[0] != "-----BEGIN PGP SIGNED MESSAGE-----":
return data
oldstdout = sys.stdout
oldstderr = sys.stderr
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__
gpg = GnuPGInterface.GnuPG()
proc = gpg.run(["--decrypt"], create_fhs=['stdin', 'stdout'])
proc.handles['stdin'].write(data)
proc.handles['stdin'].close()
plain = proc.handles['stdout'].read()
proc.handles['stdout'].close()
try:
proc.wait()
except:
pass
sys.stdout = oldstdout
sys.stderr = oldstderr
return plain
def get_entries(data):
parser = email.feedparser.FeedParser()
parser.feed(data)
return parser.close()
class DscParse(object):
"""Attempt to get the file list from the .dsc file"""
def __init__(self, data):
"""
__init__(data)
Given the contents of a .dsc, parse it and extract it's content
"""
self.entries = get_entries(unsign(data))
self.files = [x.strip().split() for x in
self.entries['Files'].splitlines()]
def verify_all(self):
"""
verify_all()
Verifies all the files, first checking the size, then the md5 sum.
Currently not used in this utility.
"""
assert self.files, "I have no files"
ret = []
for f in self.files:
ret.append(self.verify(f))
return ret
def verify(self, name):
"""
verify(name)
Verify the file 'name', first checking the size, then the md5 sum.
"""
assert self.files, "I have no files"
f = None
if isinstance(name, list):
f = name
else:
for i in self.files:
if i[2] == name:
f = i
if not f:
raise ValueError, "%s is not in the .dsc" % name
(md5sum, size, name) = tuple(f)
stat = os.stat(name)
if str(stat.st_size) != size:
return (False, name, "Expected a size of %s, got %s" % \
(size, stat.st_size))
return self.getsum(name, md5sum)
def getsum(self, name, md5sum=None):
"""
getsum(name[, md5sum])
Read the file 'name' (in 1MB chunks) and generate an md5 sum,
then compares that to the md5 sum in the .dsc file.
"""
chunk_size = 1073741824
fd = open(name, 'rb')
res = hashlib.md5()
if not md5sum:
assert self.files, "I have no files"
md5sum = [x[0] for x in self.files if x[2] == name][0]
data = fd.read(chunk_size)
while data:
res.update(data)
data = fd.read(chunk_size)
if res.hexdigest() != md5sum:
return (False, name, "Expected md5sum of %r, got %r" % \
(md5sum, res.hexdigest()))
return (True, name, None)
def is_native(self):
"""
is_native()
Returns True if this .dsc describes a native debian package;
else false.
"""
return len(self.files) == 1
# Access to fields in the .dsc via a dict-like interface
def __getitem__(self, item):
"""
x.__getitem(item) -> x[item]
"""
return self.entries.__getitem__(item)
def __contains__(self, item):
"""
x.__contains__(item) -> item in x
"""
return self.entries.__contains__(item)
def __getattr__(self, attr):
"""
x.__getattr__(attr) -> item.attr
"""
return getattr(self.entries, attr)
def error(ret, msg, *args):
"""Prints an error message, unless quiet is set, and exits with ret"""
if not Quiet:
print >> sys.stderr, msg % args
sys.exit(ret)
def debug(msg, *args):
"""If debugging is enabled, print a message"""
if Debug:
print >> sys.stderr, msg % args
def info(msg, *args):
"""If verbose is enabled, print a message"""
if Verbose:
print msg % tuple(args)
def status(msg, *args):
"""Prints a message, unless quiet is enabled"""
if not Quiet:
print msg % tuple(args)
def download(dscinfo, number, filename, verify=True):
"""download filename"""
ftype = filename.endswith(".diff.gz") and "diff.gz" or \
filename.endswith(".orig.tar.gz") and "orig.tar.gz" or \
filename.endswith(".dsc") and "dsc" or "tar.gz"
if verify and os.path.exists(filename):
info('Verifying "%s"', filename)
res = dscinfo.verify(filename)
if not res[0]:
error(104, "Verification of %s failed: %s", filename, res[2])
status("Getting %s", filename)
debug("%s%s/%s", BASE_URL, number, filename)
try:
fd = urllib2.urlopen("%s%s/%s" % (BASE_URL, number, filename))
outfd = open(filename, 'wb')
outfd.write(fd.read())
fd.close()
outfd.close()
except urllib2.HTTPError, err:
status(u"Failed to fetch «%s» file, aborting.", ftype)
error(106, "Error: (%d %s)", err.code, err.msg)
except urllib2.URLError, err:
status(u"Failed to fetch «%s» file, aborting.", ftype)
error(105, "Error: %s", err)
except IOError, err:
status('Could not create "%s"', filename)
error(107, "Error: %s", err)
def unpack(filename):
out = open('/dev/null', 'w')
err = open('/dev/null', 'w')
cmd = ["dpkg-source", "-x", filename]
ret = subprocess.call(cmd, stdout=out, stderr=err)
out.close()
err.close()
if ret:
status("Failed to unpack source, aborting.")
sys.exit(108)
def get_host(url):
return urllib2.splithost(urllib2.splittype(url)[1])[0]
def main():
global Debug, Verbose, Quiet
parser = optparse.OptionParser(usage=USAGE)
parser.add_option("-d", "--debug", action="store_true", dest="debug",
default=False, help="Enable debugging")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
default=False, help="Enable verbose output")
parser.add_option("-q", "--quiet", action="store_true", dest="quiet",
default=False, help="Never print any output")
(options, args) = parser.parse_args()
if len(args) != 1:
parser.error("Missing URL")
Debug = options.debug
Verbose = options.verbose
Quiet = options.quiet
if Verbose and Quiet:
error(4, "Specifying both --verbose and --quiet does not make sense")
if Quiet:
sys.stderr = cStringIO.StringIO()
sys.stdout = cStringIO.StringIO()
url = args[0]
if url.startswith("https://"):
url = url.replace("https://", "http://", 1)
if not url.startswith("http://"):
url = "http://" + url
if get_host(url).startswith("www."):
url = url.replace("www.", "", 1)
if get_host(url) != get_host(BASE_URL):
error(1, "Error: This utility only works for files on %s.\n"
"Maybe you want to try dget?", BASE_URL)
(number, filename) = url.split('/')[3:]
if not filename.endswith('.dsc'):
error(2, "You have to provide the URL for the .dsc file.")
try:
number = int(number)
except:
error(3, "Bad URL format")
if os.path.exists(filename):
os.remove(filename)
download(None, number, filename, False)
try:
fd = open(filename)
dsc_data = fd.read()
fd.close()
except Exception:
status("Error: Please report this bug, providing the URL and attach"
" the following backtrace")
raise
dscinfo = DscParse(dsc_data)
# launchpadlibrarian.net seems to store in this order:
# For native packages:
# <number>/.changes
# <number>+1/.tar.gz
# <number>+2/.dsc
# For non-native packages:
# <number>/.changes
# <number>+1/.orig.tar.gz
# <number>+2/.diff.gz
# <number>+3/.dsc
##
# *Assuming* this does not change, we can figure out where the files are on
# launchpadlibrarian.net relative to the .dsc file we're given.
# Only one file listed in the .dsc means it's native package
if len(dscinfo.files) == 1:
download(dscinfo, number-1, dscinfo.files[0][-1]) # .tar.gz
else:
download(dscinfo, number-1, dscinfo.files[1][-1]) # .diff.gz
download(dscinfo, number-2, dscinfo.files[0][-1]) # .orig.tar.gz
status("Unpacking")
unpack(filename)
if __name__ == "__main__":
main()

View File

@ -1,29 +0,0 @@
.TH 404main 1 "February 17, 2008" "ubuntu-dev-tools"
.SH NAME
404main \- check if all build dependencies of a package are in main
.SH SYNOPSIS
\fB404main\fP <\fIpackage name\fP> [<\fIdistribution\fP>]
.SH DESCRIPTION
\fB404main\fP is a script that can be used to check if a package and
all its build dependencies are in Ubuntu's main component or not.
.SH CAVEATS
\fB404main\fP will take the dependencies and build dependencies of the
packages from the distribution you have first in your
/etc/apt/sources.list file.
.PP
Also, because of this the <\fIdistribution\fP> option is NOT trustworthy; if
the dependencies changed YOU WILL GET INCORRECT RESULTS.
.SH SEE ALSO
.BR apt-cache (8)
.SH AUTHORS
\fB404main\fP was written by Pete Savage <petesavage@ubuntu.com> and
this manpage by Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 2 or
later.

View File

@ -39,10 +39,10 @@ development release for your distribution.
.B \-S \fISUFFIX\fR, \fB\-\-suffix\fR=\fISUFFIX\fR
Add the specified suffix to the version number when
backporting. \fBbackportpackage\fR will always append
~\fIDESTINATION\fR1 to the original version number, and if
~ubuntu\fIDESTINATION\fR.1 to the original version number, and if
\fISUFFIX\fR is specified, it is appended to that, to get version
numbers of the form
\fIORIGINAL_VERSION\fR~\fIDESTINATION\fR1\fISUFFIX\fR. If the
\fIORIGINAL_VERSION\fR~ubuntu\fIDESTINATION\fR.1\fISUFFIX\fR. If the
backported package is being uploaded to a PPA, then \fISUFFIX\fR
defaults to \fB~ppa1\fR, otherwise the default is blank.
.TP
@ -65,6 +65,12 @@ Update the build environment before attempting to build.
.B \-u \fIUPLOAD\fR, \fB\-\-upload\fR=\fIUPLOAD\fR
Upload to \fIUPLOAD\fR with \fBdput\fR(1) (after confirmation).
.TP
.B \-k \fIKEYID\fR, \fB\-\-key\fR=\fIKEYID\fR
Specify the key ID to be used for signing.
.TP
.B \-\-dont\-sign
Do not sign the upload.
.TP
.B \-y\fR, \fB\-\-yes
Do not prompt before uploading to a PPA. For everyone's safety, this
option is ignored if \fIUPLOAD\fR is \fBubuntu\fR.
@ -85,12 +91,23 @@ unpacked, built into, and otherwise manipulated in
\fIWORKDIR\fR. Otherwise, a temporary directory is created, which is
deleted before \fIbackportpackage\fR exits.
.TP
.B \-r\fR, \fB\-\-release\-pocket
Target the upload at the release pocket, rather than the
\fB\-backports\fR pocket.
This is required for Launchpad PPAs, which are pocket-less (and the
default, when the upload target is a PPA).
.TP
.B \-m \fIMIRROR\fR, \fB\-\-mirror\fR=\fIMIRROR\fR
Use the specified mirror.
Should be in the form \fBhttp://archive.ubuntu.com/ubuntu\fR.
If the package isn't found on this mirror, \fBbackportpackage\fR
will use Launchpad.
.TP
.B \-c \fIBUG\fR, \fB\-\-close\fR=\fIBUG\fR
Include a Launchpad closer for the specified bug in the auto-generated
changelog. In the future, this may actually close the bug, but
currently does not.
.TP
.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
Use the specified instance of Launchpad (e.g. "staging"), instead of
the default of "production".
@ -123,6 +140,9 @@ The default value for \fB\-\-builder\fR.
.BR BACKPORTPACKAGE_UPDATE_BUILDER ", " UBUNTUTOOLS_UPDATE_BUILDER
The default value for \fB--update\fR.
.TP
.B BACKPORTPACKAGE_UPLOAD
The default value for \fB--upload\fR.
.TP
.BR BACKPORTPACKAGE_WORKDIR ", " UBUNTUTOOLS_WORKDIR
The default value for \fB--workdir\fR.
.TP

View File

@ -1,38 +0,0 @@
.TH DGETLP "1" "27 August 2008" "ubuntu-dev-tools"
.SH NAME
dgetlp \- simulate ``dget'' behaviour for files hosted at librarian.launchpad.net
.SH SYNOPSIS
.B dgetlp [\fB\-d\fP|\fB(\fB\-v\fP|\fB\-q\fP)\fP] <\fBLaunchpad DSC URL\fP>
.SH DESCRIPTION
\fBdgetlp\fR simulates dget behaviour by downloading and extracting the <\fBLaunchpad DSC URL\fP> from the Launchpad Librarian.
.SH OPTIONS
Listed below are the command line options for dgetlp:
.TP
.B \-h, \-\-help
show this help message and exit.
.TP
.B \-d, \-\-debug
Enable debugging.
.TP
.B \-v, \-\-verbose
Enable verbose output.
.TP
.B \-q, \-\-quiet
Never print any output.
.TP
.B <Launchpad DSC URL>
This is the source package that you would like to be downloaded from the Launchpad Librarian.
.SH EXAMPLE
.B dgetlp http://launchpadlibrarian.net/10348157/coreutils_5.97-5.4ubuntu1.dsc
.SH AUTHOR
\fBdgetlp\fR was written by Terence Simpson <tsimpson@ubuntu.com> and
modified by Siegfried-A. Gevatter <rainct@ubuntu.com>. The python rewrite
was written by Terence Simpson <tsimpson@ubuntu.com> based off the original.
This man page was written by Ryan Kavanagh <ryanakca@kubuntu.org>.
Both are released under the GNU General Public License, version 2 or later.

View File

@ -1,19 +0,0 @@
.TH harvest 1 "March 21, 2011" "ubuntu-dev-tools"
.SH NAME
harvest \- grabs information about a given source package from harvest.ubuntu.com.
.SH SYNOPSIS
\fBharvest\fP <\fIsource package name\fP>
.SH DESCRIPTION
\fBharvest\fP is a script that downloads information about development
opportunities from harvest.ubuntu.com and gives a summary of the types of
opportunities.
.SH AUTHORS
\fBharvest\fP and its manpage were written by Daniel Holbach
<daniel.holbach@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 3 or
later.

View File

@ -1,26 +0,0 @@
.TH HUGDAYLIST "1" "August 27, 2008" "ubuntu-dev-tools"
.SH NAME
hugdaylist \- produce MoinMoin wiki formatted tables based on a Launchpad bug list
.SH SYNOPSIS
.B hugdaylist [\fB\-n\fP|\fB\-\-number <NUMBER>\fP] \fBlaunchpad-buglist-url\fP
.SH DESCRIPTION
\fBhugdaylist\fP produces MoinMoin wiki formatted tables based on a
Launchpad bug list
.SH OPTIONS
.TP
\fB\-\-number=<NUMBER>\fP
This option allows you to specify the number of entries to output.
.TP
\fBlaunchpad-buglist-url\fP
Required, this option is a URL pointing to a launchpad bug list.
.SH AUTHOR
\fBhugdaylist\fP has been written by Canonical Ltd., Daniel Holbach
<daniel.holbach@canonical.com> and Jonathan Patrick Davies <jpds@ubuntu.com>.
This manual page was written by Ryan Kavanagh <ryanakca@kubuntu.org>.
.PP
Both are released under the GNU General Public License, version 3.

View File

@ -1,21 +1,21 @@
.TH bitesize "1" "May 9 2010" "ubuntu-dev-tools"
.TH lp-bitesize "1" "May 9 2010" "ubuntu-dev-tools"
.SH NAME
bitesize \- Add \fBbitesize\fR tag to bugs and add a comment.
lp-bitesize \- Add \fBbitesize\fR tag to bugs and add a comment.
.SH SYNOPSIS
.B bitesize \fR<\fIbug number\fR>
.B lp-bitesize \fR<\fIbug number\fR>
.br
.B bitesize \-\-help
.B lp-bitesize \-\-help
.SH DESCRIPTION
\fBbitesize\fR adds a bitesize tag to the bug, if it's not there yet. It
\fBlp-bitesize\fR adds a bitesize tag to the bug, if it's not there yet. It
also adds a comment to the bug indicating that you are willing to help with
fixing it.
It checks for permission to operate on a given bug first,
then perform required tasks on Launchpad.
.SH OPTIONS
Listed below are the command line options for \fBbitesize\fR:
Listed below are the command line options for \fBlp-bitesize\fR:
.TP
.BR \-h ", " \-\-help
Display a help message and exit.
@ -48,7 +48,7 @@ The default value for \fB--lpinstance\fR.
.BR ubuntu\-dev\-tools (5)
.SH AUTHORS
\fBbitesize\fR and this manual page were written by Daniel Holbach
\fBlp-bitesize\fR and this manual page were written by Daniel Holbach
<daniel.holbach@canonical.com>.
.PP
Both are released under the terms of the GNU General Public License, version 3.

View File

@ -15,6 +15,10 @@ Listed below are the command line options for mk\-sbuild:
.B \-\-arch\fR=\fIARCH
What architecture to select (defaults to the native architecture).
.TP
.B \-\-target\fR=\fRARCH
Set up the chroot as a cross-building environment targeting the specified
architecture.
.TP
.B \-\-name\fR=\fINAME
Base name for the schroot (arch is appended).
.TP
@ -28,6 +32,10 @@ Turn on script debugging.
Do not include the \fB\-updates\fR pocket in the installed
\fBsources.list\fR.
.TP
.B \-\-skip\-proposed
Do not include the \fB\-proposed\fR pocket in the installed
\fBsources.list\fR.
.TP
.B \-\-source\-template\fR=\fIFILE
Use \fIFILE\fR as the \fBsources.list\fR template (defaults to
\fI$HOME\fB/.mk\-sbuild.sources\fR).
@ -47,6 +55,24 @@ Pass along a comma separated list of packages to debootstrap's
\fBWARNING:\fR be careful using this option as you can end up
excluding essential package. See \fBdebootstrap \fR(8) for more details.
.TP
.B \-\-debootstrap\-keyring\fR=\fIkeyring
Pass along the path to a gpg keyring file to debootsrap's
\fB\-\-keyring\fR argument. See \fBdebootstrap\fR (8) for more details.
.TP
.B \-\-debootstrap\-no\-check\-gpg
Disable checking gpg signatures of downloaded Release files by using
debootstrap's \fB\-\-no\-check\-gpg\fR option. See \fBdebootstrap\fR (8)
for more details.
.TP
.B \-\-debootstrap\-proxy\fR=\fIPROXY
Use \fIPROXY\fR as apt proxy.
.TP
.B \-\-eatmydata
Install and use eatmydata (default)
.TP
.B \-\-skip\-eatmydata
Don't install and use eatmydata
.TP
.B \-\-distro\fR=\fIDISTRO
Enable distro-specific logic.
When not provided, the distribution is determined from \fIrelease\fR.
@ -54,12 +80,34 @@ Currently known distros: "\fBdebian\fR" and "\fBubuntu\fR".
.TP
.B \-\-vg\fR=\fIVOLUME_GROUP
Specify a volume group, and subsequently use a default \fBSCHROOT_TYPE\fR of
"\fBlvm-snapshot\fR" rather than "\fBdirectory\fR" (via aufs) mounts.
"\fBlvm-snapshot\fR" rather than "\fBdirectory\fR" (via overlayfs or
aufs) mounts.
.TP
.B \-\-zfs-dataset=\fIDATASET
Specify a zfs dataset, and subsequently use a default \fBSCHROOT_TYPE\fR of
"\fBzfs-snapshot\fR" rather than "\fBdirectory\fR" (via overlayfs or
aufs) mounts.
.TP
.B \-\-type\fR=\fISHROOT_TYPE
Specify a \fBSCHROOT_TYPE\fR. Supported values are "\fBdirectory\fR"
(default if \fB\-\-vg\fR not specified), "\fBlvm-snapshot\fR" (default
if \fB\-\-vg\fR specified), "\fBbtrfs-snapshot\fR", and "\fBfile\fR".
if \fB\-\-vg\fR specified), "\fBbtrfs-snapshot\fR", "\fBzfs-snapshot\fR"
and "\fBfile\fR".
.TP
.B \-\-ccache
Enable usage of \fBccache\fR by default. See \fBccache\fR (1) for
more details.
.TP
.B \-\-ccache-dir=\fIPATH
Use \fBPATH\fR as schroot ccache directory. This directory can be
safely shared by multiple schroots, but they will all use the same
\fBCCACHE_MAXSIZE\fR.
Defaults to /var/cache/ccache-sbuild.
See \fBccache\fR (1) for more details.
.TP
.B \-\-ccache-size=\fISIZE
Sets \fBSIZE\fR as the schroot \fBCCACHE_DIR\fR max-size used by ccache.
See \fBccache\fR (1) for more details.
.SH ENVIRONMENT VARIABLES
.TP
@ -72,10 +120,17 @@ Size of snapshot LVs (defaults to 4G).
.B SCHROOT_CONF_SUFFIX
Lines to append to schroot entries.
.TP
.B SCHROOT_PROFILE
Profile to use with schroot. (defaults to sbuild)
.TP
.B SKIP_UPDATES
Do not include the \fB\-updates\fR pocket (same as
\fB\-\-skip\-updates\fR)
.TP
.B SKIP_PROPOSED
Do not include the \fB\-proposed\fR pocket (same as
\fB\-\-skip\-proposed\fR)
.TP
.B DEBOOTSTRAP_MIRROR
Mirror location (same as \fB\-\-debootstrap-mirror\fR)
.TP
@ -87,6 +142,22 @@ Comma separated list of packages to include when bootstrapping (same as
Comma separated list of packages to exclude when bootstrapping (same as
\fB\-\-debootstrap-exclude\fR; see warning above)
.TP
.B DEBOOTSTRAP_KEYRING
Keyring file to use for checking gpg signatures of retrieved release files
(same as \fB\-\-debootstrap\-keyring\fR)
.TP
.B DEBOOTSTRAP_NO_CHECK_GPG
Disable gpg verification of retrieved release files (same as
\fB\-\-debootstrap\-no\-check\-gpg\fR)
.TP
.B DEBOOTSTRAP_PROXY
Proxy to use for apt. (same as
\fB\-\-debootstrap\-proxy\fR)
.TP
.B EATMYDATA
Enable or disable eatmydata usage, see \fB\-\-eatmydata\fR
and \fB\-\-skip\-eatmydata\fR
.TP
.B SOURCE_CHROOTS_DIR
Use \fBSOURCE_CHROOTS_DIR\fR as home of schroot source directories.
(default \fB/var/lib/schroot/chroots\fR)
@ -98,6 +169,18 @@ Use \fBSOURCE_CHROOTS_TGZ\fR as home of schroot source tarballs.
.B CHROOT_SNAPSHOT_DIR
Use \fBCHROOT_SNAPSHOT_DIR\fR as home of mounted btrfs snapshots.
(default \fB/var/lib/schroot/snapshots\fR)
.TP
.B CCACHE
Enable \fBccache\fR (1) by default.
(defaults to \fB0\fR)
.TP
.B CCACHE_DIR
Use \fBCCACHE_DIR\fR as the \fBccache\fR (1) directory.
(default \fB/var/cache/ccache-sbuild\fR)
.TP
.B CCACHE_SIZE
Use \fBCCACHE_SIZE\fR as the \fBccache\fR (1) max-size.
(defaults to \fB4G\fR)
.SH FILES

View File

@ -20,7 +20,7 @@ like for example \fBpbuilder\-feisty\fP, \fBpbuilder\-sid\fP, \fBpbuilder\-gutsy
.PP
The same applies to \fBcowbuilder\-dist\fP, which uses cowbuilder. The main
difference between both is that pbuilder compresses the created chroot as a
a tarball, thus using less disc space but needing to uncompress (and possibly
tarball, thus using less disc space but needing to uncompress (and possibly
compress) its contents again on each run, and cowbuilder doesn't do this.
.SH USAGE
@ -35,11 +35,13 @@ Replace this with the codename of the version of Ubuntu or Debian you want to us
.TP
\fBarchitecture\fP
This optional parameter will attempt to construct a chroot in a foreign
architecture. For some architecture pairs (e.g. i386 on an amd64 install),
the chroot will be created natively. For others (e.g. armel on an i386
install), qemu-static and binfmt-misc will be used. Note that some
combinations (e.g. amd64 on an i386 install) require special separate
kernel handling, and may break in unexpected ways.
architecture.
For some architecture pairs (e.g. i386 on an amd64 install), the chroot
will be created natively.
For others (e.g. arm64 on an amd64 install), qemu\-user\-static will be
used.
Note that some combinations (e.g. amd64 on an i386 install) require
special separate kernel handling, and may break in unexpected ways.
.TP
\fBoperation\fP
Replace this with the action you want \fBpbuilder\fP to do (create, update,
@ -58,26 +60,41 @@ building is the action you want to do.
.SH OPTIONS
.TP
\fB--main-only\fP (deprecated: \fBmainonly\fP)
\fB\-\-main\-only\fP (deprecated: \fBmainonly\fP)
If you specify this option, only packages from the \fImain\fP (in Debian) or
\fImain\fP and \fIrestricted\fP (in Ubuntu) components will be used. By
default, all official components are enabled. This only has effect when
creating a new environment.
.TP
\fB--debug-echo\fP
\fB\-\-debug\-echo\fP
The generated \fBpbuilder\fP/\fBcowbuilder\fP command will be printed to the
standard output instead of being executed. This is useful for debugging.
.TP
\fB--buildresult\fP \fBDIRECTORY\fP (pbuilder-dist only)
\fB\-\-buildresult\fP \fBDIRECTORY\fP (pbuilder\-dist only)
If this option is specified, the resultant files of the \fBpbuilder\fP build
are placed in \fBDIRECTORY\fP.
.TP
\fB\-\-release\-only\fP
Only use the release pocket.
Default for development releases.
.TP
\fB\-\-security\-only\fP
Only use the release and security pockets.
Suitable environment for preparing security updates.
.TP
\fB\-\-updates\-only\fP
Only use the release, security, and updates pocket.
Not the proposed\-updates pocket.
.TP
\fB\-\-backports\fP
Also use the backports archive..
.SH EXAMPLES
.TP
pbuilder\-dist gutsy create
Creates a \fBpbuilder\fP environment for Ubuntu Gutsy, with all components enabled.
.TP
pbuilder\-sid mainonly create
pbuilder\-sid \-\-main\-only create
Creates a \fBpbuilder\fP environment for Debian Sid, with only the main component.
.TP
pbuilder\-feisty build ./sample_1.0\-0ubuntu1.dsc
@ -104,6 +121,16 @@ saved in the results subdirectory of each build environment.
The default authentication method is \fBsudo\fP. You can change this by
setting the \fBPBUILDAUTH\fP variable.
.PP
By default, \fBpbuilder\-dist\fP use the master Debian and Ubuntu mirrors.
The pbuilder \fBMIRRORSITE\fP and \fBOTHERMIRROR\fP variables are
supported, as are the standard ubuntu\-dev\-tools variables:
\fBUBUNTUTOOLS_DEBIAN_MIRROR\fP, \fBPBUILDER_DIST_DEBIAN_MIRROR\fP,
\fBUBUNTUTOOLS_DEBSEC_MIRROR\fP, \fBPBUILDER_DIST_DEBSEC_MIRROR\fP,
\fBUBUNTUTOOLS_UBUNTU_MIRROR\fP, \fBPBUILDER_DIST_UBUNTU\fP,
\fBUBUNTUTOOLS_UBUNTU_PORTS_MIRROR\fP, and
\fBPBUILDER_DIST_UBUNTU_PORTS_MIRROR\fP.
See \fBubuntu\-dev\-tools\fP (5) for details.
.PP
You may also want to know that \fBpbuilder\-dist\fP exports \fBDIST\fP and
\fBARCH\fP environment variables to the invoked process, containing the name
of the distribution and the architecture targeted by the current build. You
@ -111,13 +138,16 @@ can make use of them, for example, in \fBpbuilderrc\fP.
.SH BUGS
If you experience any problem with this script contact me on rainct@ubuntu.com
or file a bug at https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools.
or file a bug at https://bugs.launchpad.net/ubuntu/+source/ubuntu\-dev\-tools.
.PP
Please ensure first that the problem is really this script and not an issue
with \fBpbuilder\fP or \fBcowbuilder\fP themselves.
.SH SEE ALSO
\fBpbuilder\fR, \fBpbuilderrc\fR, \fBcowbuilder\fR
.BR pbuilder (1),
.BR pbuilderrc (5),
.BR cowbuilder (1),
.BR ubuntu\-dev\-tools (5).
.SH AUTHORS
\fBpbuilder\-dist\fP and this manual page were written by Siegfried-A. Gevatter

44
doc/pm-helper.1 Normal file
View File

@ -0,0 +1,44 @@
.\" Copyright (C) 2023, Canonical Ltd.
.\"
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License, version 3.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.TH pm\-helper 1 "June 2023" ubuntu\-dev\-tools
.SH NAME
pm\-helper \- helper to guide a developer through proposed\-migration work
.SH SYNOPSIS
.B pm\-helper \fR[\fIoptions\fR] [\fIpackage\fR]
.SH DESCRIPTION
Claim a package from proposed\-migration to work on and get additional
information (such as the state of the package in Debian) that may be helpful
in unblocking it.
.PP
This tool is incomplete and under development.
.SH OPTIONS
.TP
.B \-l \fIINSTANCE\fR, \fB\-\-launchpad\fR=\fIINSTANCE\fR
Use the specified instance of Launchpad (e.g. "staging"), instead of
the default of "production".
.TP
.B \-v\fR, \fB--verbose\fR
be more verbose
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help message and exit
.SH AUTHORS
\fBpm\-helper\fR and this manpage were written by Steve Langasek
<steve.langasek@ubuntu.com>.
.PP
Both are released under the GPLv3 license.

1
doc/pull-debian-ddebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-debian-debs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

View File

@ -1,89 +0,0 @@
.\" Copyright (C) 2010-2011, Stefano Rivera <stefanor@ubuntu.com>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.TH PULL\-DEBIAN\-SOURCE "1" "22 January 2011" "ubuntu\-dev\-tools"
.SH NAME
pull\-debian\-source \- download and extract a source package from Debian
.SH SYNOPSIS
.B pull\-debian\-source \fR[\fIoptions\fR] <\fIsource package\fR>
[\fIrelease\fR|\fIversion\fR]
.SH DESCRIPTION
\fBpull\-debian\-source\fR downloads and extracts the specified
\fIversion\fR of \fIsource package\fR, or the latest version in the
specified Debian \fIrelease\fR.
.P
\fBpull\-debian\-source\fR will try the preferred mirror, default
mirror, security mirror, and fall back to \fBLaunchpad\fR or
\fBsnapshot.debian.org\fR, in search of the requested version.
.SH OPTIONS
.TP
.I source package
The source package to download from Debian.
.TP
.I release
The release to download the source package from. Defaults to
\fBunstable\fR.
.TP
.I version
The specific version of the package to download.
.TP
.BR \-d ", " \-\-download\-only
Do not extract the source package.
.TP
.B \-m \fIDEBIAN_MIRROR\fR, \fB\-\-mirror\fR=\fIDEBIAN_MIRROR\fR
Use the specified mirror.
Should be in the form \fBhttp://ftp.debian.org/debian\fR.
If the package isn't found on this mirror, \fBpull\-debian\-source\fR
will fall back to the default mirror.
.TP
.B \-s \fIDEBSEC_MIRROR\fR, \fB\-\-security\-mirror\fR=\fIDEBSEC_MIRROR\fR
Use the specified mirror.
Should be in the form \fBhttp://security.debian.org\fR.
If the package isn't found on this mirror, \fBpull\-debian\-source\fR
will fall back to the default mirror.
.TP
.B \-\-no\-conf
Do not read any configuration files, or configuration from environment
variables.
.TP
.BR \-h ", " \-\-help
Display the usage instructions and exit.
.SH ENVIRONMENT
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
environment variables.
Variables in the environment take precedence to those in configuration
files.
.SH CONFIGURATION VARIABLES
The following variables can be set in the environment or in
.BR ubuntu\-dev\-tools (5)
configuration files.
In each case, the script\-specific variable takes precedence over the
package\-wide variable.
.TP
.BR PULL_DEBIAN_SOURCE_DEBIAN_MIRROR ", " UBUNTUTOOLS_DEBIAN_MIRROR
The default value for \fB\-\-mirror\fR.
.TP
.BR PULL_DEBIAN_SOURCE_DEBSEC_MIRROR ", " UBUNTUTOOLS_DEBSEC_MIRROR
The default value for \fB\-\-security\-mirror\fR.
.SH SEE ALSO
.BR dget (1),
.BR pull\-debian\-debdiff (1),
.BR pull\-lp\-source (1),
.BR ubuntu\-dev\-tools (5)

1
doc/pull-debian-source.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-debian-udebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-lp-ddebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-lp-debs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

View File

@ -1,76 +0,0 @@
.TH PULL\-LP\-SOURCE "1" "4 August 2008" "ubuntu-dev-tools"
.SH NAME
pull\-lp\-source \- download a source package from Launchpad
.SH SYNOPSIS
.B pull\-lp\-source \fR[\fIoptions\fR]\fB \fBsource package\fR
[\fIrelease\fR|\fIversion\fR]
.SH DESCRIPTION
\fBpull\-lp\-source\fR downloads and extracts the specified
\fIversion\fR of <\fBsource package\fR> from Launchpad, or the latest
version of the specified \fIrelease\fR.
If no \fIversion\fR or \fIrelease\fR is specified, the latest version in
the development release will be downloaded.
.SH OPTIONS
Listed below are the command line options for pull\-lp\-source:
.TP
.B source package
This is the source package that you would like to be downloaded from Launchpad.
.TP
.B version
This is the version of the source package to be downloaded.
.TP
.B release
This is the release that you would like the source package to be downloaded from.
This value defaults to the current development release.
.TP
.BR \-h ", " \-\-help
Display a help message and exit.
.TP
.BR \-d ", " \-\-download\-only
Do not extract the source package.
.TP
.B \-m \fIUBUNTU_MIRROR\fR, \fB\-\-mirror\fR=\fIUBUNTU_MIRROR\fR
Use the specified Ubuntu mirror.
Should be in the form \fBhttp://archive.ubuntu.com/ubuntu\fR.
If the package isn't found on this mirror, \fBpull\-lp\-source\fR will
fall back to Launchpad, as its name implies.
.TP
.B \-\-no\-conf
Do not read any configuration files, or configuration from environment
variables.
.SH ENVIRONMENT
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
environment variables.
Variables in the environment take precedence to those in configuration
files.
.TP
.B
DIST
Specifies the default target.
.SH CONFIGURATION VARIABLES
The following variables can be set in the environment or in
.BR ubuntu\-dev\-tools (5)
configuration files.
In each case, the script\-specific variable takes precedence over the
package\-wide variable.
.TP
.BR PULL_LP_SOURCE_UBUNTU_MIRROR ", " UBUNTUTOOLS_UBUNTU_MIRROR
The default value for \fB\-\-mirror\fR.
.SH SEE ALSO
.BR dget (1),
.BR pull\-debian\-source (1),
.BR pull\-debian\-debdiff (1),
.BR ubuntu\-dev\-tools (5)
.SH AUTHOR
.PP
\fBpull\-lp\-source\fR and this manual page were written by Iain Lane
<iain@orangesquash.org.uk>.
Both are released under the GNU General Public License, version 3 or later.

1
doc/pull-lp-source.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-lp-udebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

147
doc/pull-pkg.1 Normal file
View File

@ -0,0 +1,147 @@
.TH PULL\-PKG "1" "28 August 2017" "ubuntu-dev-tools"
.SH NAME
pull\-pkg \- download a package for Debian, Ubuntu, UCA, or a PPA
.SH SYNOPSIS
.B pull\-pkg \fR[\fIoptions\fR]\fR <\fIpackage name\fR>
[\fIrelease\fR|\fIversion\fR]
.SH DESCRIPTION
\fBpull\-pkg\fR downloads the specified \fIversion\fR of
<\fIpackage name\fR>, or the latest version from the
specified \fIrelease\fR. To request a version from
a particular pocket say \fIrelease\fB\-\fIpocket\fR (with a magic
\fB\-release\fR for only the release pocket). If no \fIpocket\fR is
specified, all pockets will be searched except -backports.
If no \fIversion\fR or \fIrelease\fR is specified, the latest version in
the development release will be downloaded.
There are convenience scripts that set pull type and distribution
appropriately: these are
\fBpull\-lp\-source\fR, \fBpull\-lp\-debs\fR, \fBpull\-lp\-ddebs\fR,
and \fBpull\-lp\-udebs\fR, which all pull Ubuntu packages;
\fBpull\-debian\-source\fR, \fBpull\-debian\-debs\fR, \fBpull\-debian\-ddebs\fR,
and \fBpull\-debian\-udebs\fR, which all pull Debian packages;
\fBpull\-uca\-source\fR, \fBpull\-uca\-debs\fR, \fBpull\-uca\-ddebs\fR,
and \fBpull\-uca\-udebs\fR, which all pull Ubuntu Cloud Archive packages;
and \fBpull\-ppa\-source\fR, \fBpull\-ppa\-debs\fR, \fBpull\-ppa\-ddebs\fR,
and \fBpull\-ppa\-udebs\fR, which all pull from a specified Personal Package
Archive on Launchpad. Each script pulls the file type in its name, i.e.
\fIsource\fR, \fIdebs\fR, \fIddebs\fR, or \fIudebs\fR.
.SH OPTIONS
Listed below are the command line options for pull\-pkg:
.TP
.I package name
This is name of the package to downloaded.
You can use either the source package name, or binary package name.
.TP
.I version
This is the version of the package to downloaded.
.TP
.I release
This is the release to downloaded from.
For debian, you can use either the release name like \fBjessie\fR
or \fBsid\fR, or you can use the special release names \fBunstable\fR,
\fBstable\fR, or \fBtesting\fR.
For ubuntu, you can use either the release name like \fBxenial\fR
or the release-pocket like \fBxenial-proposed\fR.
For ubuntu cloud archive (uca) you can use either the uca release
name like \fBmitaka\fR or the ubuntu and uca release names like
\fBtrusty-mitaka\fR. Defaults to the current development release.
.TP
.BR \-h ", " \-\-help
Display a help message and exit.
.TP
.BR \-v ", " \-\-verbose
Be verbose about what is being done.
.TP
.BR \-d ", " \-\-download\-only
Do not extract the source package (applies only to source packages).
.TP
.B \-m \fIMIRROR\fR, \fB\-\-mirror\fR=\fIMIRROR\fR
Use the specified mirror server.
Should be in the form \fBhttp://archive.ubuntu.com/ubuntu\fR or
\fBhttp://deb.debian.org/debian\fR. If not specified or if the
package is not found on the specified mirror, this will fall
back to the default mirror(s) and/or mirror(s) from environment
variables, and then will fall back to Launchpad or Debian Snapshot.
This can be specified multiple times to try multiple mirrors.
.TP
.B \-\-no\-conf
Do not use mirrors from the default configuration, or from
any environment variables.
.TP
.B \-a \fIARCH\fR, \fB\-\-arch\fR=\fIARCH\fR
Get binary packages from the \fIARCH\fR architecture.
Defaults to the local architecture, if it can be deteected.
.TP
.B \-p \fIPULL\fR, \fB\-\-pull\fR=\fIPULL\fR
What to pull: \fBsource\fR, \fBdebs\fR, \fBddebs\fR, \fBudebs\fR,
or \fBlist\fR. The \fBlist\fR action only lists all a package's
source and binary files, but does not actually download any.
Defaults to \fBsource\fR.
.TP
.B \-D \fIDISTRO\fR, \fB\-\-distro\fR=\fIDISTRO\fR
Pull from: \fBdebian\fR, \fBuca\fR, \fBubuntu\fR, or a \fBppa\fR.
\fBlp\fR can be used instead of \fBubuntu\fR.
Any string containing \fBcloud\fR can be used instead of \fBuca\fR.
If pulling from a ppa, you must specify the PPA. Defaults to \fBubuntu\fR.
.TP
.B \-\-ppa\fR=ppa:\fIUSER/NAME\fR
Applies only when \fBdistro\fR is \fIppa\fR. Can be provided either as
a value to the \fB\-\-ppa\fR option parameter, or as a plain option
(like \fIrelease\fR or \fIversion\fR). When specified as a plain option,
the form must be \fBppa:USER/NAME\fR; when specified as a value to the
\fB\-\-ppa\fR option parameter, the leading \fBppa:\fR is optional.
.SH ENVIRONMENT
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
environment variables.
Variables in the environment take precedence to those in configuration
files.
.SH CONFIGURATION VARIABLES
The following variables can be set in the environment or in
.BR ubuntu\-dev\-tools (5)
configuration files.
In each case, the script\-specific variable takes precedence over the
package\-wide variable.
.TP
.BR UBUNTUTOOLS_UBUNTU_MIRROR
The default mirror.
.TP
.BR PULL_PKG_UBUNTU_MIRROR
The default mirror when using the \fBpull\-pkg\fR script.
.TP
.BR PULL_[LP|DEBIAN|PPA|UCA]_[SOURCE|DEBS|DDEBS|UDEBS]_MIRROR
The default mirror when using the associated script.
.SH SEE ALSO
.BR dget (1),
.BR pull\-lp\-source (1),
.BR pull\-lp\-debs (1),
.BR pull\-lp\-ddebs (1),
.BR pull\-lp\-udebs (1),
.BR pull\-debian\-source (1),
.BR pull\-debian\-debs (1),
.BR pull\-debian\-ddebs (1),
.BR pull\-debian\-udebs (1),
.BR pull\-ppa\-source (1),
.BR pull\-ppa\-debs (1),
.BR pull\-ppa\-ddebs (1),
.BR pull\-ppa\-udebs (1),
.BR pull\-uca\-source (1),
.BR pull\-uca\-debs (1),
.BR pull\-uca\-ddebs (1),
.BR pull\-uca\-udebs (1),
.BR pull\-debian\-debdiff (1),
.BR ubuntu\-dev\-tools (5)
.SH AUTHOR
.PP
\fBpull\-pkg\fR was written by Dan Streetman <ddstreet@canonical.com>,
based on the original \fBpull\-lp\-source\fR; it and this manual page
were written by Iain Lane <iain@orangesquash.org.uk>.
All are released under the GNU General Public License, version 3 or later.

1
doc/pull-ppa-ddebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-ppa-debs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-ppa-source.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-ppa-udebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

View File

@ -1,27 +0,0 @@
.TH PULL\-REVU\-SOURCE "1" "30 August 2009" "ubuntu-dev-tools"
.SH NAME
pull\-revu\-source \- download a source package from REVU
.SH SYNOPSIS
.B pull\-revu\-source \fR[\fB\-h\fR]\fB <\fBsource package\fR>
.SH DESCRIPTION
\fBpull\-revu\-source\fR downloads and extracts the latest version of
<\fBsource package\fR> from REVU.
.SH OPTIONS
Listed below are the command line options for pull\-revu\-source:
.TP
.B \-h, \-\-help
Display the usage instructions and exit.
.TP
.B <source package>
This is the source package that you would like to be downloaded from Debian.
.SH AUTHOR
.PP
\fBpull\-revu\-source\fR and this manual page were written by Nathan Handler
<nhandler@ubuntu.com>. \fBpull\-revu\-source\fR is based on \fBrevupull\fR in
\fBkubuntu\-dev\-tools\fR, written by Harald Sitter <apachelogger@ubuntu.com>.
Both are released under the GNU General Public License, version 3 or later.

1
doc/pull-uca-ddebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-uca-debs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-uca-source.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

1
doc/pull-uca-udebs.1 Symbolic link
View File

@ -0,0 +1 @@
pull-pkg.1

57
doc/requestbackport.1 Normal file
View File

@ -0,0 +1,57 @@
.\" Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.TH requestbackport 1 "November 2011" ubuntu\-dev\-tools
.SH NAME
requestbackport \- File a backport request bug
.SH SYNOPSIS
.B requestbackport \fR[\fIoptions\fR] \fIpackage\fR
.SH DESCRIPTION
Determine the intermediate releases that \fIpackage\fR needs to be
backported to, list all reverse\-dependencies, and file the backporting
request.
\fBrequestbackport\fR will include a testing checklist in the bug.
.SH OPTIONS
.TP
\fB\-d\fR \fIDEST\fR, \fB\-\-destination\fR=\fIDEST\fR
Backport to \fIDEST\fR release and necessary intermediate
releases. Default: current stable release.
.TP
\fB\-s\fR \fISOURCE\fR, \fB\-\-source\fR=\fISOURCE\fR
Backport from \fISOURCE\fR release.
Default: current development release.
.TP
\fB\-l\fR \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
Launchpad instance to connect to.
Default: \fBproduction\fR.
.TP
\fB\-\-no\-conf\fR
Don't read config files or environment variables
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help message and exit.
.SH SEE ALSO
.BR backportpackage (1),
.BR reverse\-depends (1),
.BR https://wiki.ubuntu.com/UbuntuBackports .
.SH AUTHORS
\fBrequestbackport\fR and this manpage were written by Stefano Rivera
<stefanor@ubuntu.com>.
.PP
Both are released under the terms of the ISC License.

View File

@ -11,14 +11,10 @@ requestsync \- helper to file sync requests for Ubuntu
\fBrequestsync\fR looks at the versions of <source package> in Debian and
Ubuntu and prompts for an explanation of why the Ubuntu changes (if there
are any) should be dropped.
The changelog entry is then downloaded from packages.debian.org.
If the sync request is being filed per email (default), a prompt for your
GPG passphrase follows so that it can sign the mail and send it off to
Launchpad.
Alternatively a sync request can be filed directly using the launchpadlib
Python module (option \fB\-\-lp\fR).
\fBrequestsync\fR falls back to mail the sync request if submitting using
the launchpadlib module fails.
The changelog entry is then downloaded from packages.debian.org, and the
sync request bug is filed in launchpad.
Alternatively, the sync request can be filed by GPG\-signed email (option
\fB\-\-email\fR).
.PP
\fBrequestsync\fR checks if you have the permissions to request the sync from
@ -28,7 +24,7 @@ you don't have upload permissions, the script will subscribe the necessary
team with approval rights to the bug report for you.
This check is only performed if \fBrequestsync\fR is allowed to use the LP API
(option \fB\-\-lp\fR). In the other case \fBrequestsync\fR relies on that you
(not email submission). In the other case \fBrequestsync\fR relies on that you
answer the question about upload permissions honestly to determine if a team
with approval rights is to be subscribed to the bug.
@ -48,7 +44,7 @@ Display a help message and exit.
.TP
.B \-d
Specifies which Debian distribution a package should be synced from.
Default is \fItesting\fR in LTS cycles, otherwise \fIunstable\fR.
Default is \fIunstable\fR.
.TP
.B \-n
Specifies that the package is a new package, and requestsync should not
@ -58,9 +54,8 @@ attempt to look it up in Ubuntu since it will not exist.
Specifies your GPG key.
This is only used if the sync request is mailed to Launchpad.
.TP
.B \-\-lp
Use the launchpadlib Python module (packaged as python\-launchpadlib) to
file the sync request in Launchpad.
.B \-\-email
Use GPG\-signed email to file the bug, rather than launchpadlib.
.TP
.B \-s
Specifies that you require sponsorship.
@ -126,10 +121,13 @@ Sets which port of the SMTP server to use. Default is 25.
Sets the username and password to use when authenticating to the SMTP server.
.TP
.BR REQUESTSYNC_USE_LPAPI
Setting this to \fIyes\fR is equivalent to running with \fB--lp\fR.
Setting this to \fIno\fR is equivalent to running with \fB--email\fR.
.TP
.BR REQUESTSYNC_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
The default value for \fB--lpinstance\fR.
.TP
.BR REQUESTSYNC_KEYID ", " UBUNTUTOOLS_KEYID
The default value for \fB-k\fR.
.SH SEE ALSO
.BR rmadison (1),

View File

@ -1,172 +0,0 @@
.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "BUILD-RDEPS 1"
.TH BUILD-RDEPS 1 "2008-08-14" "Debian Utilities" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
build\-rdeps \- find packages that depend on a specific package to build (reverse build depends)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBubuild-rdeps\fR \fIpackage\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBubuild-rdeps\fR searches for all packages that build-depend on the specified package.
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-u\fR \fB\-\-update\fR" 4
.IX Item "-u --update"
Run apt-get update before searching for build-depends.
.IP "\fB\-s\fR \fB\-\-sudo\fR" 4
.IX Item "-s --sudo"
Use sudo when running apt-get update. Has no effect if \-u is omitted.
.IP "\fB\-\-distribution\fR" 4
.IX Item "--distribution"
Select another distribution, which is searched for build-depends.
.IP "\fB\-m\fR \fB\-\-print\-maintainer\fR" 4
.IX Item "-m --print-maintainer"
Print the value of the maintainer field for each package.
.IP "\fB\-d\fR \fB\-\-debug\fR" 4
.IX Item "-d --debug"
Run the debug mode
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
Show the usage information.
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
Show the version information.
.SH "LICENSE"
.IX Header "LICENSE"
This code is copyright by Patrick Schoenfeld
<schoenfeld@in\-medias\-res.com>, all rights reserved.
This program comes with \s-1ABSOLUTELEY\s0 \s-1NO\s0 \s-1WARRANTY\s0.
You are free to redistribute this code under the terms of the
\&\s-1GNU\s0 General Public License, version 2 or later.
.SH "AUTHOR"
.IX Header "AUTHOR"
Patrick Schoenfeld <schoenfeld@in\-medias\-res.com>

81
doc/reverse-depends.1 Normal file
View File

@ -0,0 +1,81 @@
.\" Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.TH reverse\-depends 1 "November 2011" ubuntu\-dev\-tools
.SH NAME
reverse\-depends \- List the reverse\-dependencies (or
build\-dependencies) of a package
.SH SYNOPSIS
.B reverse\-depends \fR[\fIoptions\fR] \fIpackage
.SH DESCRIPTION
List reverse\-dependencies (or build\-dependencies) of \fIpackage\fR.
If the package name is prefixed with \fBsrc:\fR then the
reverse\-dependencies of all the binary packages that the specified
source package builds will be listed.
.SH OPTIONS
.TP
\fB\-r\fR \fIRELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Query dependencies in \fIRELEASE\fR.
Default: current development release.
.TP
\fB\-R\fR, \fB\-\-without\-recommends\fR
Only consider Depends relationships, not Recommends.
.TP
\fB\-s\fR, \fB\-\-with\-suggests\fR
Also consider Suggests relationships.
.TP
\fB\-b\fR, \fB\-\-build\-depends\fR
Query build dependencies.
Synonym for \fB\-\-arch\fR=\fIsource\fR.
.TP
\fB\-a\fR \fIARCH\fR, \fB\-\-arch\fR=\fIARCH\fR
Query dependencies in \fIARCH\fR.
Besides valid architecture names, the special values \fBany\fR and
\fBsource\fR may be used.
\fBany\fR displays all reverse dependencies, the union across all
architecture.
\fBsource\fR displays build dependencies.
Default: \fBany\fR.
.TP
\fB\-c\fR \fICOMPONENT\fR, \fB\-\-component\fR=\fICOMPONENT\fR
Only consider reverse\-dependencies in \fICOMPONENT\fR. Can
be specified multiple times.
Default: all components.
.TP
\fB\-l\fR, \fB\-\-list\fR
Display a simple, machine\-readable list.
.TP
\fB\-u\fR \fIURL\fR, \fB\-\-service\-url\fR=\fIURL\fR
Reverse Dependencies web\-service \fIURL\fR.
Default: UbuntuWire's service at
\fBhttp://qa.ubuntuwire.org/rdepends/\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help message and exit
.SH EXAMPLES
All reverse dependencies of source package bash:
.IP
.nf
.B reverse\-depends src:bash
.fi
.SH AUTHORS
\fBreverse\-depends\fR and this manpage were written by Stefano Rivera
<stefanor@ubuntu.com>.
.PP
Both are released under the terms of the ISC License.

View File

@ -0,0 +1,15 @@
.TH running\-autopkgtests "1" "18 January 2024" "ubuntu-dev-tools"
.SH NAME
running\-autopkgtests \- dumps a list of currently running autopkgtests
.SH SYNOPSIS
.B running\-autopkgtests
.SH DESCRIPTION
Dumps a list of currently running and queued tests in Autopkgtest.
Pass --running to only see running tests, or --queued to only see
queued tests. Passing both will print both, which is the default behavior.
.SH AUTHOR
.B running\-autopkgtests
was written by Chris Peterson <chris.peterson@canonical.com>.

60
doc/seeded-in-ubuntu.1 Normal file
View File

@ -0,0 +1,60 @@
.\" Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.TH seeded\-in\-ubuntu 1 "December 2011" ubuntu\-dev\-tools
.SH NAME
seeded\-in\-ubuntu \- Determine whether a package is safe to upload
during a freeze
.SH SYNOPSIS
.B seeded\-in\-ubuntu \fR[\fIoptions\fR] \fIpackage\fR...
.SH DESCRIPTION
Lists all the current daily images containing the specified packages.
Or whether the package is part of the supported seed.
.PP
If it isn't on an image, it should be safe to upload.
During the final freeze, one should avoid packages in the supported seed
too.
.PP
An index of the current manifests is downloaded from UbuntuWire.
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-binary\fR
The packages specified are binary packages.
This is faster than source packages, as otherwise we must query LP to
determine the binary packages that every specified source package
builds.
.TP
\fB\-u\fR \fIURL\fR, \fB\-\-data\-url\fR=\fIURL\fR
URL for index of seeded packages.
Default: UbuntuWire's service at
\fBhttp://qa.ubuntuwire.org/ubuntu-seeded-packages/seeded.json.gz\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help message and exit
.SH EXAMPLES
All the images that contain unity:
.IP
.nf
.B seeded\-in\-ubuntu -b unity
.fi
.SH AUTHORS
\fBseeded\-in\-ubuntu\fR and this manpage were written by Stefano Rivera
<stefanor@ubuntu.com>.
.PP
Both are released under the terms of the ISC License.

View File

@ -6,7 +6,13 @@
\fBsetup-packaging-environment\fR
.SH DESCRIPTION
\fBsetup-packaging-environment\fR aims to make it more straightforward for new contributors to get their Ubuntu installation ready for packaging work. It ensures that all four components from Ubuntu's official repositories are enabled along with their corresponding source repositories. It also installs a minimal set of packages needed for Ubuntu packaging work (ubuntu-dev-tools, devscripts, debhelper, cdbs, patchutils, pbuilder, and build-essential). Finally, it assists in defining the DEBEMAIL and DEBFULLNAME environment variables.
\fBsetup-packaging-environment\fR aims to make it more straightforward for new
contributors to get their Ubuntu installation ready for packaging work. It
ensures that all four components from Ubuntu's official repositories are enabled
along with their corresponding source repositories. It also installs a minimal
set of packages needed for Ubuntu packaging work (ubuntu-dev-tools, devscripts,
debhelper, patchutils, pbuilder, and build-essential). Finally, it assists
in defining the DEBEMAIL and DEBFULLNAME environment variables.
.SH AUTHORS
\fBsetup-packaging-environment\fR was written by Siegfried-A. Gevatter <rainct@ubuntu.com>.

View File

@ -14,9 +14,6 @@ builds it, runs
.BR lintian (1)
and, after review and confirmation, can upload it.
For syncs, sponsor\-patch will follow the usual procedure of commenting
on \fIbug\fR, marking it confirmed, and subscribing \fBubuntu-archive\fR.
\fBsponsor\-patch\fR can be used for sponsoring patches, syncs and
merges from Debian, SRUs, and creating debdiffs from patches.
If \fIbug\fR has multiple patches or branches linked, it will prompt the
@ -45,7 +42,7 @@ The changelog target must be valid.
The changelog timestamp is touched.
.PP
Should any checks (or the build fail), the user has an option to edit
Should any checks (or the build) fail, the user has an option to edit
the patched source and try building it again.
.PP
Unless a working directory is specified, the sources and patches will be
@ -129,6 +126,9 @@ The default value for \fB--update\fR.
.TP
.BR SPONSOR_PATCH_WORKDIR ", " UBUNTUTOOLS_WORKDIR
The default value for \fB--workdir\fR.
.TP
.BR SPONSOR_PATCH_KEYID ", " UBUNTUTOOLS_KEYID
The default value for \fB--key\fR.
.SH EXAMPLES
Test-building and sponsoring an upload of bug \fB1234\fR:

View File

@ -1,12 +1,14 @@
.TH SYNCPACKAGE "1" "June 2010" "ubuntu-dev-tools"
.SH NAME
syncpackage \- copy source packages from Debian to Ubuntu
.\"
.SH SYNOPSIS
.B syncpackage
[\fIoptions\fR] \fI<.dsc URL/path or package name>\fR
[\fIoptions\fR] \fI<.dsc URL/path or package name(s)>\fR
.\"
.SH DESCRIPTION
\fBsyncpackage\fR causes a source package to be copied from Debian to
Ubuntu.
\fBsyncpackage\fR causes one or more source package(s) to be copied from Debian
to Ubuntu.
.PP
\fBsyncpackage\fR allows you to upload files with the same checksums of the
Debian ones, as the common script used by Ubuntu archive administrators does,
@ -14,24 +16,26 @@ this way you can preserve source files integrity between the two distributions.
.PP
\fBsyncpackage\fR will detect source tarballs with mismatching
checksums, and can perform fake syncs.
.\"
.SH WARNING
The use of \fBsyncpackage \-\-no\-lp\fR, which generates a changes file to
be directly uploaded to the Ubuntu primary archive or a PPA, is discouraged
by the Ubuntu Archive Administrators, as it introduces an unnecessary window
for error.
This only exists for backward compatibility, for unusual corner cases, and
for uploads to archives other than the Ubuntu primary archive.
This only exists for backward compatibility, for unusual corner cases
(such as fakesyncs), and for uploads to archives other than the Ubuntu
primary archive.
Omitting this option will cause Launchpad to perform the sync request
directly, which is the preferred method for uploads to the Ubuntu primary
archive.
.\"
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Show help message and exit
.TP
\fB\-d\fI DIST\fR, \fB\-\-distribution\fR=\fIDIST\fR
Debian distribution to sync from. Default is \fItesting\fR during LTS
cycles, and \fIunstable\fR otherwise.
Debian distribution to sync from. Default is \fIunstable\fR.
.TP
\fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Specify target Ubuntu release. Default: current development release.
@ -42,20 +46,45 @@ Specify the version to sync from.
\fB\-c\fI COMPONENT\fR, \fB\-\-component\fR=\fICOMPONENT\fR
Specify the component to sync from.
.TP
\fB\-b\fI BUG\fR, \fB\-\-bug\fR=\fIBUG\fR
Mark a Launchpad bug as being fixed by this upload.
.TP
\fB\-s\fI USERNAME\fR, \fB\-\-sponsor\fR=\fIUSERNAME\fR
Sponsor the sync for \fIUSERNAME\fR (a Launchpad username).
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Display more progress information.
.TP
.B \-\-no\-lp
Construct sync locally rather than letting Launchpad copy the package
directly (not recommended).
.TP
\fB\-F\fR, \fB\-\-fakesync\fR
Perform a fakesync, to work around a tarball mismatch between Debian and
Ubuntu. This option ignores blacklisting, and performs a local sync.
Ubuntu.
This option ignores blocklisting, and performs a local sync.
It implies \fB\-\-no\-lp\fR, and will leave a signed \fB.changes\fR file
for you to upload.
.TP
\fB\-f\fR, \fB\-\-force\fR
Force sync over the top of Ubuntu changes.
.TP
.B \-\-no\-conf
Do not read any configuration files, or configuration from environment
variables.
.TP
\fB\-l\fI INSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
Launchpad instance to connect to (default: production).
.TP
.B \-\-simulate
Show what would be done, but don't actually do it.
.\"
.SH LOCAL SYNC PREPARATION OPTIONS
.TP
Options that only apply when using \fB\-\-no\-lp\fR:
.TP
.B \-\-no\-lp
Construct sync locally, rather than letting Launchpad copy the package
directly.
It will leave a signed \fB.changes\fR file for you to upload.
See the \fBWARNING\fR above.
.TP
\fB\-n\fI UPLOADER_NAME\fR, \fB\-\-uploader\-name\fR=\fIUPLOADER_NAME\fR
Use UPLOADER_NAME as the name of the maintainer for this upload instead
of evaluating DEBFULLNAME and UBUMAIL.
@ -72,12 +101,6 @@ Specify the key ID to be used for signing.
\fB\-\-dont-sign\fR
Do not sign the upload.
.TP
\fB\-b\fI BUG\fR, \fB\-\-bug\fR=\fIBUG\fR
Mark a Launchpad bug as being fixed by this upload.
.TP
\fB\-f\fR, \fB\-\-force\fR
Force sync over the top of Ubuntu changes.
.TP
.B \-d \fIDEBIAN_MIRROR\fR, \fB\-\-debian\-mirror\fR=\fIDEBIAN_MIRROR\fR
Use the specified mirror.
Should be in the form \fBhttp://ftp.debian.org/debian\fR.
@ -89,13 +112,7 @@ Use the specified Debian security mirror.
Should be in the form \fBhttp://archive.ubuntu.com/ubuntu\fR.
If the package isn't found on this mirror, \fBsyncpackage\fR will fall
back to the default mirror.
.TP
.B \-\-no\-conf
Do not read any configuration files, or configuration from environment
variables.
.TP
.B \-\-simulate
Show what would be done, but don't actually do it.
.\"
.SH ENVIRONMENT
.TP
.BR DEBFULLNAME ", " DEBEMAIL ", " UBUMAIL
@ -108,6 +125,7 @@ All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
environment variables.
Variables in the environment take precedence to those in configuration
files.
.\"
.SH CONFIGURATION VARIABLES
The following variables can be set in the environment or in
.BR ubuntu\-dev\-tools (5)
@ -120,12 +138,17 @@ The default value for \fB\-\-debian\-mirror\fR.
.TP
.BR SYNCPACKAGE_UBUNTU_MIRROR ", " UBUNTUTOOLS_DEBSEC_MIRROR
The default value for \fB\-\-ubuntu\-mirror\fR.
.TP
.BR SYNCPACKAGE_KEYID ", " UBUNTUTOOLS_KEYID
The default value for \fB\-\-key\fR.
.\"
.SH SEE ALSO
.BR requestsync (1),
.BR ubuntu\-dev\-tools (5)
.\"
.SH AUTHOR
\fBsyncpackage\fR was written by Martin Pitt <martin.pitt@canonical.com> and Benjamin Drung <bdrung@ubuntu.com>.
.PP
This manual page were written by Luca Falavigna <dktrkranz@ubuntu.com>
This manual page was written by Luca Falavigna <dktrkranz@ubuntu.com>
.PP
Both are released under GNU General Public License, version 3.

View File

@ -1,20 +1,19 @@
.TH UBUNTU-BUILD "1" "June 2010" "ubuntu-dev-tools"
.TH UBUNTU-BUILD "1" "Mar 2024" "ubuntu-dev-tools"
.SH NAME
ubuntu-build \- command-line interface to Launchpad build operations
.SH SYNOPSIS
.B ubuntu-build <srcpackage> <release> <operation>
.nf
\fBubuntu-build\fR <srcpackage> <release> <operation>
\fBubuntu-build\fR --batch [--retry] [--rescore \fIPRIORITY\fR] [--arch \fIARCH\fR [...]]
[--series \fISERIES\fR] [--state \fIBUILD-STATE\fR]
[-A \fIARCHIVE\fR] [pkg]...
.fi
.SH DESCRIPTION
\fBubuntu-build\fR provides a command line interface to the Launchpad build
operations.
.PP
\fBubuntu-build\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to authenticate
to Launchpad.
This cookie is created on run from the Mozilla Firefox cookie
file at \fI~/.mozilla/*/*/cookies.sqlite\fR.
.SH OPERATIONS
Listed below are the available operations for \fBubuntu-build\fR:
.TP
@ -43,8 +42,8 @@ operations.
.IP
\fB\-a\fR ARCHITECTURE, \fB\-\-arch\fR=\fIARCHITECTURE\fR
Rebuild or rescore a specific architecture. Valid
architectures include: amd64, sparc, powerpc, i386,
armel, ia64, lpia, hppa.
architectures are:
armhf, arm64, amd64, i386, powerpc, ppc64el, riscv64, s390x.
.TP
Batch processing:
.IP
@ -64,14 +63,16 @@ Retry builds (give\-back).
\fB\-\-rescore\fR=\fIPRIORITY\fR
Rescore builds to <priority>.
.IP
\fB\-\-arch2\fR=\fIARCHITECTURE\fR
\fB\-\-arch\fR=\fIARCHITECTURE\fR
Affect only 'architecture' (can be used several
times). Valid architectures are: amd64, sparc,
powerpc, i386, armel, ia64, lpia, hppa.
times). Valid architectures are:
arm64, amd64, i386, powerpc, ppc64el, riscv64, s390x.
.IP
\fB\-A=\fIARCHIVE\fR
Act on the named archive (ppa) instead of on the main Ubuntu archive.
.SH AUTHORS
\fBubuntu-build\fR was written by Martin Pitt <martin.pitt@canonical.com>, and
this manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>.
.PP
Both are released under the terms of the GNU General Public License, version 3
or (at your option) any later version.
Both are released under the terms of the GNU General Public License, version 3.

View File

@ -76,6 +76,12 @@ Should be of the form \fBhttp://archive.ubuntu.com/ubuntu\fR (no
trailing slash).
If not specified, the master will be used.
.TP
.B UBUNTUTOOLS_UBUNTU_PORTS_MIRROR
The preferred Ubuntu archive mirror.
Should be of the form \fBhttp://ports.ubuntu.com\fR (no
trailing slash).
If not specified, the master will be used.
.TP
.B UBUNTUTOOLS_LPINSTANCE
The launchpad instance to communicate with. e.g. \fBproduction\fR
(default) or \fBstaging\fR.

View File

@ -0,0 +1,60 @@
.\" Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.TH ubuntu\-upload\-permission 1 "November 2011" ubuntu\-dev\-tools
.SH NAME
ubuntu\-upload\-permission \- Query upload rights and (optionally) list
the people and teams with upload rights for a package
.SH SYNOPSIS
.B ubuntu\-upload\-permission \fR[\fIoptions\fR] \fIpackage
.SH DESCRIPTION
\fBubuntu\-upload\-permission\fR checks if the user has upload
permissions for \fIpackage\fR.
If the \fB\-\-list\-uploaders\fR option is provided, all the people and
teams that do have upload rights for \fIpackage\fR will be listed.
.SH OPTIONS
.TP
\fB\-r\fR \fIRELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Query permissions in \fIRELEASE\fR.
Default: current development release.
.TP
\fB\-a\fR, \fB\-\-list\-uploaders\fR
List all the people and teams who have upload rights for \fIpackage\fR.
.TP
\fB\-t\fR, \fB\-\-list\-team\-members\fR
List all the members of every team with rights. (Implies
\fB\-\-list\-uploaders\fR)
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help message and exit
.SH EXIT STATUS
.TP
.B 0
You have the necessary upload rights.
.TP
.B 1
You don't have the necessary upload rights.
.TP
.B 2
There was an error.
.SH AUTHORS
\fBubuntu\-upload\-permission\fR and this manpage were written by
Stefano Rivera <stefanor@ubuntu.com>.
.PP
Both are released under the terms of the ISC License.

62
enforced-editing-wrapper Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/python3
#
# Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
#
# Wraps sensisible-editor in checks for remaining boilerplate.
# Configured through environment variables:
# UDT_EDIT_WRAPPER_EDITOR: The user's usual $EDITOR
# UDT_EDIT_WRAPPER_VISUAL: The user's usual $VISUAL
# UDT_EDIT_WRAPPER_TEMPLATE_RE: An extra boilerplate-detecting regex.
# UDT_EDIT_WRAPPER_FILE_DESCRIPTION: The type of file being edited.
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import argparse
import os
import re
from ubuntutools.question import EditFile
def main():
parser = argparse.ArgumentParser(usage="%(prog)s [options] filename")
parser.add_argument("filename", help=argparse.SUPPRESS)
args = parser.parse_args()
if not os.path.isfile(args.filename):
parser.error(f"File {args.filename} does not exist")
if "UDT_EDIT_WRAPPER_EDITOR" in os.environ:
os.environ["EDITOR"] = os.environ["UDT_EDIT_WRAPPER_EDITOR"]
else:
del os.environ["EDITOR"]
if "UDT_EDIT_WRAPPER_VISUAL" in os.environ:
os.environ["VISUAL"] = os.environ["UDT_EDIT_WRAPPER_VISUAL"]
else:
del os.environ["VISUAL"]
placeholders = []
if "UDT_EDIT_WRAPPER_TEMPLATE_RE" in os.environ:
placeholders.append(re.compile(os.environ["UDT_EDIT_WRAPPER_TEMPLATE_RE"]))
description = os.environ.get("UDT_EDIT_WRAPPER_FILE_DESCRIPTION", "file")
EditFile(args.filename, description, placeholders).edit()
if __name__ == "__main__":
main()

View File

@ -59,10 +59,10 @@ fi
if [ "$RSYNC" = "y" ]; then
URL="merges.ubuntu.com:/srv/patches.ubuntu.com/merges/$HASH/$MERGE/"
rsync --verbose --archive --progress --compress --delete \
"$URL" . || { echo "Error while rsyncing $URL"; exit 1; }
"$URL" . || { echo "Error while rsyncing $URL"; exit 1; }
else
rm -rf --one-file-system *
wget -q https://merges.ubuntu.com/$HASH/$MERGE/REPORT || {
wget -nv https://merges.ubuntu.com/$HASH/$MERGE/REPORT || {
echo "Package not found on merges.ubuntu.com."
[ "$CREATED_DIR" != "1" ] || { cd ..; rmdir $MERGE; }
exit 1

View File

@ -1,4 +1,4 @@
#! /usr/bin/python
#! /usr/bin/python3
#
# grep-merges - search for pending merges from Debian
#
@ -19,35 +19,70 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import urllib2
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import argparse
import json
import sys
from httplib2 import Http, HttpLib2Error
import ubuntutools.misc
from ubuntutools import getLogger
Logger = getLogger()
def main():
parser = argparse.ArgumentParser(
usage="%(prog)s [options] [string]",
description="List pending merges from Debian matching string",
)
parser.add_argument("string", nargs="?", help=argparse.SUPPRESS)
args = parser.parse_args()
ubuntutools.misc.require_utf8()
if len(sys.argv) > 1:
match = sys.argv[1]
else:
match = None
for component in ('main', 'main-manual',
'restricted', 'restricted-manual',
'universe', 'universe-manual',
'multiverse', 'multiverse-manual'):
page = urllib2.urlopen('http://merges.ubuntu.com/%s.json' % component)
for merge in json.load(page):
package = merge['source_package']
author, uploader = '', ''
if 'user' in merge:
author = merge['user']
if 'uploader' in merge:
uploader = '(%s)' % merge['uploader']
pretty_uploader = ' '.join((author, uploader)).strip()
if (match is None or
match in package or match in author or match in uploader):
print '%s\t%s' % (package, pretty_uploader)
for component in (
"main",
"main-manual",
"restricted",
"restricted-manual",
"universe",
"universe-manual",
"multiverse",
"multiverse-manual",
):
url = f"https://merges.ubuntu.com/{component}.json"
try:
headers, page = Http().request(url)
except HttpLib2Error as e:
Logger.exception(e)
sys.exit(1)
if headers.status != 200:
Logger.error("%s: %s %s", url, headers.status, headers.reason)
sys.exit(1)
if __name__ == '__main__':
for merge in json.loads(page):
package = merge["source_package"]
author, uploader = "", ""
if merge.get("user"):
author = merge["user"]
if merge.get("uploader"):
uploader = f"({merge['uploader']})"
teams = merge.get("teams", [])
pretty_uploader = f"{author} {uploader}"
if (
args.string is None
or args.string in package
or args.string in author
or args.string in uploader
or args.string in teams
):
Logger.info("%s\t%s", package, pretty_uploader)
if __name__ == "__main__":
main()

51
harvest
View File

@ -1,51 +0,0 @@
#!/usr/bin/python
# Copyright (C) 2011 Canonical Ltd., Daniel Holbach
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL-3 for more details.
#
# ##################################################################
#
#
# harvest - grabs information about development opportunities from
# harvest.ubuntu.com
#
#
# Daniel Holbach
# (c) 2011 Canonical
from optparse import OptionParser
import sys
from devscripts.logger import Logger
from ubuntutools.harvest import Harvest
def main():
usage = "usage: %prog source-package-name"
opt_parser = OptionParser(usage)
args = opt_parser.parse_args()[1]
if len(args) != 1:
opt_parser.print_help()
sys.exit(1)
pkg = args[0].strip()
print Harvest(pkg).report()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
Logger.error("Aborted.")
sys.exit(1)

View File

@ -1,136 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Canonical Ltd., Daniel Holbach
# Copyright (C) 2008 Jonathan Patrick Davies <jpds@ubuntu.com>
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL-3 for more details.
#
# ##################################################################
#
#
# hugdaylist - produces MoinMoin wiki formatted tables based on a Launchpad bug
# list.
#
# hugdaylist <url>
# - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw
#
# hugdaylist -n <howmany> <url>
# - will only list <howmany> URLs.
import sys
from optparse import OptionParser
from launchpadlib.launchpad import Launchpad
from ubuntutools.lp.libsupport import translate_web_api
def check_args():
howmany = -1
url = ""
# Our usage options.
usage = "usage: %prog [-n <number>] launchpad-buglist-url"
opt_parser = OptionParser(usage)
# Options - namely just the number of bugs to output.
opt_parser.add_option("-n", "--number", type="int",
dest="number", help="Number of entries to output.")
# Parse arguments.
(options, args) = opt_parser.parse_args()
# Check if we want a number other than the default.
howmany = options.number
# Check that we have an URL.
if not args:
print >> sys.stderr, "An URL pointing to a Launchpad bug list is " \
"required."
opt_parser.print_help()
sys.exit(1)
else:
url = args[0]
return (howmany, url)
def filter_unsolved(task):
# TODO: don't use this filter here, only check status and assignee of
# the given task
# Filter out special types of bugs:
# - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs
# this is expensive, parse name out of self_link instead?
subscriptions = set(s.person.name for s in task.bug.subscriptions)
if (task.status != "Fix Committed" and
(not task.assignee or task.assignee.name in ['motu','desktop-bugs']) and
'ubuntu-sponsors' not in subscriptions and
'ubuntu-archive' not in subscriptions):
return True
return False
def main():
(howmany, url) = check_args()
if len(url.split("?", 1)) == 2:
# search options not supported, because there is no mapping web ui
# options <-> API options
print >> sys.stderr, "Options in url are not supported, url: %s" % url
sys.exit(1)
launchpad = None
try:
launchpad = Launchpad.login_with("ubuntu-dev-tools", 'production')
except IOError, error:
print error
sys.exit(1)
api_url = translate_web_api(url, launchpad)
try:
product = launchpad.load(api_url)
except Exception, error:
response = getattr(error, "response", {})
if response.get("status", None) == "404":
print >> sys.stderr, ("The URL at '%s' does not appear to be a "
"valid url to a product") % url
sys.exit(1)
else:
raise
bug_list = [b for b in product.searchTasks() if filter_unsolved(b)]
if not bug_list:
print "Bug list of %s is empty." % url
sys.exit(0)
if howmany == -1:
howmany = len(bug_list)
print """
## ||<rowbgcolor="#CCFFCC"> This task is done || somebody || ||
## ||<rowbgcolor="#FFFFCC"> This task is assigned || somebody || <status> ||
## ||<rowbgcolor="#FFEBBB"> This task isn't || ... || ||
## ||<rowbgcolor="#FFCCCC"> This task is blocked on something || somebody || <explanation> ||
|| Bug || Subject || Triager ||"""
for i in list(bug_list)[:howmany]:
bug = i.bug
print '||<rowbgcolor="#FFEBBB"> [%s %s] || %s || ||' % \
(bug.web_link, bug.id, bug.title)
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print >> sys.stderr, "Aborted."
sys.exit(1)

View File

@ -1,5 +1,4 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#!/usr/bin/python3
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
# 2010, 2011 Stefano Rivera <stefanor@ubuntu.com>
@ -22,66 +21,66 @@
#
# ##################################################################
from optparse import OptionParser, SUPPRESS_HELP
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import argparse
import logging
import re
import sys
import webbrowser
from collections.abc import Iterable
from email.message import EmailMessage
from devscripts.logger import Logger
try:
import SOAPpy
except ImportError:
Logger.error("Please install 'python-soappy' in order to use this utility.")
sys.exit(1)
import debianbts
from launchpadlib.launchpad import Launchpad
from ubuntutools import getLogger
from ubuntutools.config import UDTConfig
def main():
Logger = getLogger()
ATTACHMENT_MAX_SIZE = 2000
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument(
"-b",
"--browserless",
action="store_true",
help="Don't open the bug in the browser at the end",
)
parser.add_argument(
"-l",
"--lpinstance",
metavar="INSTANCE",
help="LP instance to connect to (default: production)",
)
parser.add_argument(
"-v", "--verbose", action="store_true", help="Print info about the bug being imported"
)
parser.add_argument(
"-n",
"--dry-run",
action="store_true",
help="Don't actually open a bug (also sets verbose)",
)
parser.add_argument(
"-p", "--package", help="Launchpad package to file bug against (default: Same as Debian)"
)
parser.add_argument(
"--no-conf", action="store_true", help="Don't read config files or environment variables."
)
parser.add_argument("bugs", nargs="+", help="Bug number(s) or URL(s)")
return parser.parse_args()
def get_bug_numbers(bug_list: Iterable[str]) -> list[int]:
bug_re = re.compile(r"bug=(\d+)")
url = 'http://bugs.debian.org/cgi-bin/soap.cgi'
namespace = 'Debbugs/SOAP'
debbugs = SOAPpy.SOAPProxy(url, namespace)
# debug
#debbugs.config.dumpSOAPOut = 1
#debbugs.config.dumpSOAPIn = 1
parser = OptionParser(usage="%prog [option] bug ...")
parser.add_option("-b", "--browserless",
help="Don't open the bug in the browser at the end",
dest="browserless", action="store_true")
parser.add_option("-l", "--lpinstance", metavar="INSTANCE",
help="Launchpad instance to connect to "
"(default: production)",
dest="lpinstance", default=None)
parser.add_option("-n", "--dry-run",
help=SUPPRESS_HELP,
dest="lpinstance", action="store_const", const="staging")
parser.add_option("-p", "--package", metavar="PACKAGE",
help="Launchpad package to file bug against "
"(default: Same as Debian)",
dest="package", default=None)
parser.add_option("--no-conf", dest="no_conf", default=False,
help="Don't read config files or environment variables.",
action="store_true")
(options, args) = parser.parse_args()
config = UDTConfig(options.no_conf)
if options.lpinstance is None:
options.lpinstance = config.get_value("LPINSTANCE")
launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
debian = launchpad.distributions['debian']
ubuntu = launchpad.distributions['ubuntu']
lp_debbugs = launchpad.bug_trackers.getByName(name='debbugs')
bug_nums = []
for bug_num in args:
for bug_num in bug_list:
if bug_num.startswith("http"):
# bug URL
match = bug_re.search(bug_num)
@ -90,48 +89,168 @@ def main():
sys.exit(1)
bug_num = match.groups()[0]
bug_num = bug_num.lstrip("#")
bug_num = int(bug_num)
bug_nums.append(bug_num)
bug_nums.append(int(bug_num))
bugs = debbugs.get_status(*bug_nums)
return bug_nums
if len(bug_nums) > 1:
bugs = bugs[0]
def walk_multipart_message(message: EmailMessage) -> tuple[str, list[tuple[int, EmailMessage]]]:
summary = ""
attachments = []
i = 1
for part in message.walk():
content_type = part.get_content_type()
if content_type.startswith("multipart/"):
# we're already iterating on multipart items
# let's just skip the multipart extra metadata
continue
if content_type == "application/pgp-signature":
# we're not interested in importing pgp signatures
continue
if part.is_attachment():
attachments.append((i, part))
elif content_type.startswith("image/"):
# images here are not attachment, they are inline, but Launchpad can't handle that,
# so let's add them as attachments
summary += f"Message part #{i}\n"
summary += f"[inline image '{part.get_filename()}']\n\n"
attachments.append((i, part))
elif content_type.startswith("text/html"):
summary += f"Message part #{i}\n"
summary += "[inline html]\n\n"
attachments.append((i, part))
elif content_type == "text/plain":
summary += f"Message part #{i}\n"
summary += part.get_content() + "\n"
else:
raise RuntimeError(
f"""Unknown message part
Your Debian bug is too weird to be imported in Launchpad, sorry.
You can fix that by patching this script in ubuntu-dev-tools.
Faulty message part:
{part}"""
)
i += 1
return summary, attachments
def process_bugs(
bugs: Iterable[debianbts.Bugreport],
launchpad: Launchpad,
package: str,
dry_run: bool = True,
browserless: bool = False,
) -> bool:
debian = launchpad.distributions["debian"]
ubuntu = launchpad.distributions["ubuntu"]
lp_debbugs = launchpad.bug_trackers.getByName(name="debbugs")
err = False
for bug in bugs:
ubupackage = bug.source
if package:
ubupackage = package
bug_num = bug.bug_num
subject = bug.subject
log = debianbts.get_bug_log(bug_num)
message = log[0]["message"]
assert isinstance(message, EmailMessage)
attachments: list[tuple[int, EmailMessage]] = []
if message.is_multipart():
summary, attachments = walk_multipart_message(message)
else:
summary = str(message.get_payload())
target = ubuntu.getSourcePackage(name=ubupackage)
if target is None:
Logger.error(
"Source package '%s' is not in Ubuntu. Please specify "
"the destination source package with --package",
ubupackage,
)
err = True
continue
description = f"Imported from Debian bug http://bugs.debian.org/{bug_num}:\n\n{summary}"
# LP limits descriptions to 50K chars
description = (description[:49994] + " [...]") if len(description) > 50000 else description
Logger.debug("Target: %s", target)
Logger.debug("Subject: %s", subject)
Logger.debug("Description: ")
Logger.debug(description)
for i, attachment in attachments:
Logger.debug("Attachment #%s (%s)", i, attachment.get_filename() or "inline")
Logger.debug("Content:")
if attachment.get_content_type() == "text/plain":
content = attachment.get_content()
if len(content) > ATTACHMENT_MAX_SIZE:
content = (
content[:ATTACHMENT_MAX_SIZE]
+ f" [attachment cropped after {ATTACHMENT_MAX_SIZE} characters...]"
)
Logger.debug(content)
else:
Logger.debug("[data]")
if dry_run:
Logger.info("Dry-Run: not creating Ubuntu bug.")
continue
u_bug = launchpad.bugs.createBug(target=target, title=subject, description=description)
for i, attachment in attachments:
name = f"#{i}-{attachment.get_filename() or "inline"}"
content = attachment.get_content()
if isinstance(content, str):
# Launchpad only wants bytes
content = content.encode()
u_bug.addAttachment(
filename=name,
data=content,
comment=f"Imported from Debian bug http://bugs.debian.org/{bug_num}",
)
d_sp = debian.getSourcePackage(name=package)
if d_sp is None and package:
d_sp = debian.getSourcePackage(name=package)
d_task = u_bug.addTask(target=d_sp)
d_watch = u_bug.addWatch(remote_bug=bug_num, bug_tracker=lp_debbugs)
d_task.bug_watch = d_watch
d_task.lp_save()
Logger.info("Opened %s", u_bug.web_link)
if not browserless:
webbrowser.open(u_bug.web_link)
return err
def main() -> None:
options = parse_args()
config = UDTConfig(options.no_conf)
if options.lpinstance is None:
options.lpinstance = config.get_value("LPINSTANCE")
if options.dry_run:
launchpad = Launchpad.login_anonymously("ubuntu-dev-tools")
options.verbose = True
else:
launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
if options.verbose:
Logger.setLevel(logging.DEBUG)
bugs = debianbts.get_status(get_bug_numbers(options.bugs))
if not bugs:
Logger.error("Cannot find any of the listed bugs")
sys.exit(1)
for bug in bugs:
bug = bug.value
ubupackage = package = bug.source
if options.package:
ubupackage = options.package
bug_num = bug.bug_num
subject = bug.subject
log = debbugs.get_bug_log(bug_num)
summary = log[0][0]
target = ubuntu.getSourcePackage(name=ubupackage)
if target is None:
Logger.error("Source package '%s' is not in Ubuntu. Please specify "
"the destination source package with --package",
ubupackage)
sys.exit(1)
if process_bugs(bugs, launchpad, options.package, options.dry_run, options.browserless):
sys.exit(1)
u_bug = launchpad.bugs.createBug(target=target, title=subject,
description='Imported from Debian bug '
'http://bugs.debian.org/%d:\n\n%s'
% (bug_num, summary))
d_sp = debian.getSourcePackage(name=package)
if d_sp is None and options.package:
d_sp = debian.getSourcePackage(name=options.package)
d_task = u_bug.addTask(target=d_sp)
d_watch = u_bug.addWatch(remote_bug=bug_num, bug_tracker=lp_debbugs)
d_task.bug_watch = d_watch
d_task.lp_save()
Logger.normal("Opened %s", u_bug.web_link)
if not options.browserless:
webbrowser.open(u_bug.web_link)
if __name__ == '__main__':
if __name__ == "__main__":
main()

105
lp-bitesize Executable file
View File

@ -0,0 +1,105 @@
#!/usr/bin/python3
"""Add 'bitesize' tag to bugs and add a comment."""
# Copyright (c) 2011 Canonical Ltd.
#
# bitesize is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# bitesize is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with bitesize; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# Authors:
# Daniel Holbach <daniel.holbach@canonical.com>
import argparse
import sys
from launchpadlib.errors import HTTPError
from launchpadlib.launchpad import Launchpad
from ubuntutools import getLogger
from ubuntutools.config import UDTConfig
Logger = getLogger()
def error_out(msg, *args):
Logger.error(msg, *args)
sys.exit(1)
def save_entry(entry):
try:
entry.lp_save()
except HTTPError as error:
error_out("%s", error.content)
def tag_bug(bug):
bug.tags = bug.tags + ["bitesize"] # LP: #254901 workaround
save_entry(bug)
def main():
parser = argparse.ArgumentParser(usage="%(prog)s [options] <bug number>")
parser.add_argument(
"-l",
"--lpinstance",
metavar="INSTANCE",
help="Launchpad instance to connect to (default: production)",
dest="lpinstance",
default=None,
)
parser.add_argument(
"--no-conf",
help="Don't read config files or environment variables.",
dest="no_conf",
default=False,
action="store_true",
)
parser.add_argument("bug_number", help=argparse.SUPPRESS)
args = parser.parse_args()
config = UDTConfig(args.no_conf)
if args.lpinstance is None:
args.lpinstance = config.get_value("LPINSTANCE")
launchpad = Launchpad.login_with("ubuntu-dev-tools", args.lpinstance)
if launchpad is None:
error_out("Couldn't authenticate to Launchpad.")
# check that the new main bug isn't a duplicate
try:
bug = launchpad.bugs[args.bug_number]
except HTTPError as error:
if error.response.status == 401:
error_out(
"Don't have enough permissions to access bug %s. %s",
args.bug_number,
error.content,
)
else:
raise
if "bitesize" in bug.tags:
error_out("Bug is already marked as 'bitesize'.")
bug.newMessage(
content="I'm marking this bug as 'bitesize' as it looks "
"like an issue that is easy to fix and suitable "
"for newcomers in Ubuntu development. If you need "
"any help with fixing it, talk to me about it."
)
bug.subscribe(person=launchpad.me)
tag_bug(launchpad.bugs[bug.id]) # fresh bug object, LP: #336866 workaround
if __name__ == "__main__":
main()

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2008 Canonical Ltd.
# Author: Scott James Remnant <scott at ubuntu.com>.
@ -18,248 +18,67 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import sys
from debian.changelog import Changelog
from ubuntutools import getLogger
Logger = getLogger()
def usage(exit_code=1):
print '''Usage: merge-changelog <left changelog> <right changelog>
Logger.info(
"""Usage: merge-changelog <left changelog> <right changelog>
merge-changelog takes two changelogs that once shared a common source,
merges them back together, and prints the merged result to stdout. This
is useful if you need to manually merge a ubuntu package with a new
Debian release of the package.
'''
"""
)
sys.exit(exit_code)
########################################################################
# Changelog Management
########################################################################
# Regular expression for top of debian/changelog
CL_RE = re.compile(r'^(\w[-+0-9a-z.]*) \(([^\(\) \t]+)\)((\s+[-0-9a-z]+)+)\;',
re.IGNORECASE)
def merge_changelog(left_changelog, right_changelog):
"""Merge a changelog file."""
left_cl = read_changelog(left_changelog)
right_cl = read_changelog(right_changelog)
with open(left_changelog, encoding="utf-8") as f:
left_cl = Changelog(f)
with open(right_changelog, encoding="utf-8") as f:
right_cl = Changelog(f)
for right_ver, right_text in right_cl:
while len(left_cl) and left_cl[0][0] > right_ver:
(left_ver, left_text) = left_cl.pop(0)
print left_text
left_versions = set(left_cl.versions)
right_versions = set(right_cl.versions)
left_blocks = iter(left_cl)
right_blocks = iter(right_cl)
while len(left_cl) and left_cl[0][0] == right_ver:
(left_ver, left_text) = left_cl.pop(0)
clist = sorted(left_versions | right_versions, reverse=True)
remaining = len(clist)
for version in clist:
remaining -= 1
if version in left_versions:
block = next(left_blocks)
if version in right_versions:
next(right_blocks)
else:
block = next(right_blocks)
print right_text
assert block.version == version
for _, left_text in left_cl:
print left_text
return False
def read_changelog(filename):
"""Return a parsed changelog file."""
entries = []
changelog_file = open(filename)
try:
(ver, text) = (None, "")
for line in changelog_file:
match = CL_RE.search(line)
if match:
try:
ver = Version(match.group(2))
except ValueError:
ver = None
text += line
elif line.startswith(" -- "):
if ver is None:
ver = Version("0")
text += line
entries.append((ver, text))
(ver, text) = (None, "")
elif len(line.strip()) or ver is not None:
text += line
finally:
changelog_file.close()
if len(text):
entries.append((ver, text))
return entries
########################################################################
# Version parsing code
########################################################################
# Regular expressions make validating things easy
VALID_EPOCH = re.compile(r'^[0-9]+$')
VALID_UPSTREAM = re.compile(r'^[A-Za-z0-9+:.~-]*$')
VALID_REVISION = re.compile(r'^[A-Za-z0-9+.~]+$')
# Character comparison table for upstream and revision components
CMP_TABLE = "~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-.:"
class Version(object):
"""Debian version number.
This class is designed to be reasonably transparent and allow you
to write code like:
| s.version >= '1.100-1'
The comparison will be done according to Debian rules, so '1.2' will
compare lower.
Properties:
epoch Epoch
upstream Upstream version
revision Debian/local revision
"""
def __init__(self, ver):
"""Parse a string or number into the three components."""
self.epoch = 0
self.upstream = None
self.revision = None
ver = str(ver)
if not len(ver):
raise ValueError
# Epoch is component before first colon
idx = ver.find(":")
if idx != -1:
self.epoch = ver[:idx]
if not len(self.epoch):
raise ValueError
if not VALID_EPOCH.search(self.epoch):
raise ValueError
ver = ver[idx+1:]
# Revision is component after last hyphen
idx = ver.rfind("-")
if idx != -1:
self.revision = ver[idx+1:]
if not len(self.revision):
raise ValueError
if not VALID_REVISION.search(self.revision):
raise ValueError
ver = ver[:idx]
# Remaining component is upstream
self.upstream = ver
if not len(self.upstream):
raise ValueError
if not VALID_UPSTREAM.search(self.upstream):
raise ValueError
self.epoch = int(self.epoch)
def get_without_epoch(self):
"""Return the version without the epoch."""
string = self.upstream
if self.revision is not None:
string += "-%s" % (self.revision,)
return string
without_epoch = property(get_without_epoch)
def __str__(self):
"""Return the class as a string for printing."""
string = ""
if self.epoch > 0:
string += "%d:" % (self.epoch,)
string += self.upstream
if self.revision is not None:
string += "-%s" % (self.revision,)
return string
def __repr__(self):
"""Return a debugging representation of the object."""
return "<%s epoch: %d, upstream: %r, revision: %r>" \
% (self.__class__.__name__, self.epoch,
self.upstream, self.revision)
def __cmp__(self, other):
"""Compare two Version classes."""
other = Version(other)
result = cmp(self.epoch, other.epoch)
if result != 0:
return result
result = deb_cmp(self.upstream, other.upstream)
if result != 0:
return result
result = deb_cmp(self.revision or "", other.revision or "")
if result != 0:
return result
return 0
def strcut(string, idx, accept):
"""Cut characters from string that are entirely in accept."""
ret = ""
while idx < len(string) and string[idx] in accept:
ret += string[idx]
idx += 1
return (ret, idx)
def deb_order(string, idx):
"""Return the comparison order of two characters."""
if idx >= len(string):
return 0
elif string[idx] == "~":
return -1
else:
return CMP_TABLE.index(string[idx])
def deb_cmp_str(x, y):
"""Compare two strings in a deb version."""
idx = 0
while (idx < len(x)) or (idx < len(y)):
result = deb_order(x, idx) - deb_order(y, idx)
if result < 0:
return -1
elif result > 0:
return 1
idx += 1
return 0
def deb_cmp(x, y):
"""Implement the string comparison outlined by Debian policy."""
x_idx = y_idx = 0
while x_idx < len(x) or y_idx < len(y):
# Compare strings
(x_str, x_idx) = strcut(x, x_idx, CMP_TABLE)
(y_str, y_idx) = strcut(y, y_idx, CMP_TABLE)
result = deb_cmp_str(x_str, y_str)
if result != 0:
return result
# Compare numbers
(x_str, x_idx) = strcut(x, x_idx, "0123456789")
(y_str, y_idx) = strcut(y, y_idx, "0123456789")
result = cmp(int(x_str or "0"), int(y_str or "0"))
if result != 0:
return result
return 0
Logger.info("%s%s", str(block).strip(), "\n" if remaining else "")
def main():
if len(sys.argv) > 1 and sys.argv[1] in ('-h', '--help'):
if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
usage(0)
if len(sys.argv) != 3:
usage(1)
@ -270,5 +89,6 @@ def main():
merge_changelog(left_changelog, right_changelog)
sys.exit(0)
if __name__ == '__main__':
if __name__ == "__main__":
main()

573
mk-sbuild
View File

@ -1,11 +1,13 @@
#!/bin/bash
#
# Copyright 2006-2011 (C) Canonical Ltd.
# Copyright 2006-2013 (C) Canonical Ltd.
# Authors:
# Kees Cook <kees@ubuntu.com>
# Emmet Hikory <persia@ubuntu.com>
# Scott Moser <smoser@ubuntu.com>
# Stefano Rivera <stefanor@ubuntu.com>
# Steve Langasek <steve.langasek@ubuntu.com>
# Marc Deslauriers <marc.deslauriers@ubuntu.com>
#
# ##################################################################
#
@ -24,7 +26,7 @@
# ##################################################################
#
# This script creates chroots designed to be used in a snapshot mode
# (either with LVM or aufs) with schroot and sbuild.
# (with LVM, btrfs, zfs, overlay, overlay or aufs) with schroot and sbuild.
# Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto,
# and https://help.ubuntu.com/community/SbuildLVMHowto.
#
@ -37,28 +39,47 @@ SNAPSHOT_SIZE="4G"
SOURCE_CHROOTS_DIR="/var/lib/schroot/chroots"
SOURCE_CHROOTS_TGZ="/var/lib/schroot/tarballs"
CHROOT_SNAPSHOT_DIR="/var/lib/schroot/snapshots"
SCHROOT_PROFILE="sbuild"
CCACHE_DIR="/var/cache/ccache-sbuild"
CCACHE_SIZE="4G"
function usage()
{
echo "Usage: $0 [OPTIONS] Release" >&2
echo "Usage: $0 [OPTIONS] Release"
echo "Options:"
echo " --arch=ARCH What architecture to select"
echo " --name=NAME Base name for the schroot (arch is appended)"
echo " --personality=PERSONALITY What personality to use (defaults to match --arch)"
echo " --vg=VG use LVM snapshots, with group VG"
echo " --zfs-dataset=DATASET use ZFS snapshots, with parent dataset DATASET"
echo " --debug Turn on script debugging"
echo " --skip-updates Do not include -updates pocket in sources.list"
echo " --skip-security Do not include -security pocket in sources.list"
echo " --skip-proposed Do not include -proposed pocket in sources.list"
echo " --source-template=FILE Use FILE as the sources.list template"
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
echo " --debootstrap-include=list Comma separated list of packages to include"
echo " --debootstrap-exclude=list Comma separated list of packages to exclude"
echo " --debootstrap-opts=OPTS Extra options passed to debootstrap"
echo " --debootstrap-proxy=URL Use PROXY as apt proxy"
echo " --debootstrap-keyring=KEYRING"
echo " Use KEYRING to check signatures of retrieved Release files"
echo " --debootstrap-no-check-gpg Disables checking gpg signatures of retrieved Release files"
echo " --skip-eatmydata Don't install and use eatmydata"
echo " --eatmydata Install and use eatmydata (default)"
echo " --ccache Install configure and use ccache as default"
echo " --ccache-dir=PATH Sets the CCACHE_DIR to PATH"
echo " (can be shared between all schroots, defaults to ${CCACHE_DIR})"
echo " --ccache-size=SIZE Sets the ccache max-size to SIZE"
echo " (shared by each CCACHE_DIR, defaults to ${CCACHE_SIZE})"
echo " --distro=DISTRO Install specific distro:"
echo " 'ubuntu' or 'debian' "
echo " (defaults to determining from release name)"
echo " --target=ARCH Target architecture for cross-building"
echo " --type=SCHROOT_TYPE Define the schroot type:"
echo " 'directory'(default), 'file', or 'btrfs-snapshot'"
echo " 'directory' (default), 'file', or 'btrfs-snapshot'."
echo " 'lvm-snapshot' is selected via --vg"
echo " 'zfs-snapshot' is selected via --zfs-dataset"
echo ""
echo "Configuration (via ~/.mk-sbuild.rc)"
echo " LV_SIZE Size of source LVs (default ${LV_SIZE})"
@ -67,11 +88,23 @@ function usage()
echo " SOURCE_CHROOTS_TGZ Directory to store file source chroots"
echo " CHROOT_SNAPSHOT_DIR Directory to mount open btrfs snaphshot chroots (default ${CHROOT_SNAPSHOT_DIR})"
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
echo " SCHROOT_PROFILE Profile to use with schroot (default ${SCHROOT_PROFILE})"
echo " SKIP_UPDATES Enable --skip-updates"
echo " SKIP_PROPOSED Enable --skip-proposed"
echo " SKIP_SECURITY Enable --skip-security"
echo " DEBOOTSTRAP_MIRROR Mirror location (same as --debootstrap-mirror)"
echo " DEBOOTSTRAP_INCLUDE Included packages (same as --debootstrap-include)"
echo " DEBOOTSTRAP_EXCLUDE Excluded packages (same as --debootstrap-exclude)"
echo " DEBOOTSTRAP_OPTS Extra options passed to debootstrap (same as --debootstrap-opts)"
echo " DEBOOTSTRAP_PROXY Apt proxy (same as --debootstrap-proxy)"
echo " DEBOOTSTRAP_KEYRING GPG keyring (same as --debootstrap-keyring)"
echo " DEBOOTSTRAP_NO_CHECK_GPG Disable GPG verification (same as --debootstrap-no-check-gpg)"
echo " EATMYDATA Enable or disable eatmydata usage, see --eatmydata and --skip-eatmydata"
echo " CCACHE Enable --ccache"
echo " CCACHE_DIR Path for ccache (can be shared between all schroots, "
echo " same as --ccache-dir, default ${CCACHE_DIR})"
echo " CCACHE_SIZE Sets the ccache max-size (shared by each CCACHE_DIR, "
echo " same as --ccache-size, default ${CCACHE_SIZE})"
echo " TEMPLATE_SOURCES A template for sources.list"
echo " TEMPLATE_SCHROOTCONF A template for schroot.conf stanza"
if [ -z "$1" ]; then
@ -84,26 +117,62 @@ function usage()
if [ -z "$1" ]; then
usage
fi
OPTS=`getopt -o 'h' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,debootstrap-include:,debootstrap-exclude:,debootstrap-proxy:,personality:,distro:,vg:,type:" -- "$@"`
supported_options=(
help
debug
skip-updates
skip-security
skip-proposed
skip-eatmydata
ccache
arch:
name:
source-template:
debootstrap-mirror:
debootstrap-include:
debootstrap-exclude:
debootstrap-opts:
debootstrap-proxy:
debootstrap-no-check-gpg
debootstrap-keyring:
personality:
distro:
vg:
zfs-dataset:
type:
target:
ccache-dir:
ccache-size:
)
OPTS=$(getopt -o 'h' --long "$(IFS=, && echo "${supported_options[*]}")" -- "$@")
eval set -- "$OPTS"
VG=""
DISTRO=""
COMMAND_PREFIX=""
name=""
proxy="_unset_"
DEBOOTSTRAP_NO_CHECK_GPG=0
EATMYDATA=1
CCACHE=0
USE_PKGBINARYMANGLER=0
while :; do
case "$1" in
--debug)
DEBUG=1
set -x
shift
;;
--arch)
CHROOT_ARCH="$2"
if [ "$2" = "i386" ] || [ "$2" = "lpia" ] && [ -z "$personality" ];
then
personality="linux32"
fi
case $2 in
armhf|i386)
if [ -z "$personality" ]; then
personality="linux32"
fi
;;
esac
shift 2
;;
--personality)
@ -114,6 +183,14 @@ while :; do
SKIP_UPDATES="1"
shift
;;
--skip-proposed)
SKIP_PROPOSED="1"
shift
;;
--skip-security)
SKIP_SECURITY="1"
shift
;;
--name)
name="$2"
shift 2
@ -138,10 +215,31 @@ while :; do
DEBOOTSTRAP_EXCLUDE="$2"
shift 2
;;
--debootstrap-opts)
DEBOOTSTRAP_OPTS="$2"
shift 2
;;
--debootstrap-proxy)
proxy="$2"
shift 2
;;
--debootstrap-keyring)
# Store the absolute path because we cd to the root directory later.
DEBOOTSTRAP_KEYRING=$(readlink -f "$2")
shift 2
;;
--debootstrap-no-check-gpg)
DEBOOTSTRAP_NO_CHECK_GPG=1
shift
;;
--skip-eatmydata)
EATMYDATA=0
shift
;;
--ccache)
CCACHE=1
shift
;;
--distro)
DISTRO="$2"
shift 2
@ -150,10 +248,26 @@ while :; do
VG="$2"
shift 2
;;
--zfs-dataset)
ZFS_PARENT_DATASET="$2"
shift 2
;;
--type)
SCHROOT_TYPE="$2"
shift 2
;;
--target)
TARGET_ARCH="$2"
shift 2
;;
--ccache-dir)
CCACHE_DIR="$2"
shift 2
;;
--ccache-size)
CCACHE_SIZE="$2"
shift 2
;;
--)
shift
break
@ -168,9 +282,15 @@ done
# will not exist in the chroot.
cd /
# Make sure we've got a regular user
if [ -w /etc/passwd ]; then
echo "Please run this script as a regular user, not root." >&2
if [ -w /etc/passwd -a ! -e ~/.sbuildrc -a ! -e ~/.mk-sbuild.rc ]; then
cat >&2 <<EOF
It's recommended to run this script as a regular user, not root, so that it
uses the configuration files in your home directory.
It will use sudo to escalate to root as necessary.
If you really do want to use it as root, create a .sbuildrc or .mk-sbuild.rc
in root's home.
EOF
exit 1
fi
@ -184,10 +304,26 @@ if [ ! -w /var/lib/sbuild ]; then
# Prepare a usable default .sbuildrc
if [ ! -e ~/.sbuildrc ]; then
cat > ~/.sbuildrc <<EOM
# *** VERIFY AND UPDATE \$mailto and \$maintainer_name BELOW ***
# *** THIS COMMAND IS DEPRECATED ***
#
# In sbuild 0.87.0 and later, the unshare backend is available. This is
# expected to become the default in a future release.
#
# This is the new preferred way of building Debian packages, making the manual
# creation of schroots no longer necessary. To retain the default behavior,
# you may remove this comment block and continue.
#
# To test the unshare backend while retaining the default settings, run sbuild
# with --chroot-mode=unshare like this:
# $ sbuild --chroot-mode=unshare --dist=unstable hello
#
# To switch to the unshare backend by default (recommended), uncomment the
# following lines and delete the rest of the file (with the exception of the
# last two lines):
#\$chroot_mode = 'unshare';
#\$unshare_mmdebstrap_keep_tarball = 1;
# Mail address where logs are sent to (mandatory, no default!)
\$mailto = '$USER';
# *** VERIFY AND UPDATE \$mailto and \$maintainer_name BELOW ***
# Name to use as override in .changes files for the Maintainer: field
#\$maintainer_name='$USER <$USER@localhost>';
@ -236,7 +372,12 @@ fi
# Determine distribution and possible synonyms
synonym=""
EXPERIMENTAL=0
if debian-distro-info --all | grep -Fqx "$RELEASE"; then
if [ "$RELEASE" = "experimental" ]; then
DISTRO="${DISTRO:-debian}"
EXPERIMENTAL=1
name="${name:-experimental}"
RELEASE=$(debian-distro-info --devel)
elif debian-distro-info --all | grep -Fqx "$RELEASE"; then
DISTRO="${DISTRO:-debian}"
if [ "$RELEASE" = $(debian-distro-info --devel) ]; then
synonym=unstable
@ -265,16 +406,53 @@ elif [ "$RELEASE" = "oldstable" ]; then
DISTRO="${DISTRO:-debian}"
synonym="$RELEASE"
RELEASE=$(debian-distro-info --old)
elif [ "$RELEASE" = "experimental" ]; then
DISTRO="${DISTRO:-debian}"
EXPERIMENTAL=1
name="${name:-experimental}"
RELEASE=$(debian-distro-info --devel)
elif [ -z "$DISTRO" ]; then
echo "Unable to determine distribution, please provide --distro" >&2
exit 1
fi
# By default DEBOOTSTRAP_SCRIPT must match RELEASE
DEBOOTSTRAP_SCRIPT="$RELEASE"
dist_ge() {
local releases="$($3-distro-info --all)"
local left=999
local right=0
local seq=1
for i in $releases; do
if [ $1 = $i ]; then
local left=$seq
break
fi
seq=$((seq+1))
done
seq=1
for i in $releases; do
if [ $2 = $i ]; then
local right=$seq
break
fi
seq=$((seq+1))
done
[ $left -ge $right ] && return 0 || return 1
}
ubuntu_dist_ge () {
dist_ge $1 $2 ubuntu
}
debian_dist_ge () {
dist_ge $1 $2 debian
}
if [ "$DISTRO" = "ubuntu" ]; then
# On Ubuntu, set DEBOOTSTRAP_SCRIPT to gutsy to allow building new RELEASES without new debootstrap
DEBOOTSTRAP_SCRIPT=gutsy
fi
# By default, name the schroot the same as the release
if [ -z "$name" ]; then
name="$RELEASE"
@ -289,7 +467,11 @@ if [ -z "$CHROOT_ARCH" ]; then
CHROOT_ARCH="$HOST_ARCH"
fi
CHROOT_NAME="${name}-${CHROOT_ARCH}"
if [ -z "$TARGET_ARCH" ]; then
CHROOT_NAME="${name}-${CHROOT_ARCH}"
else
CHROOT_NAME="${name}-${CHROOT_ARCH}-${TARGET_ARCH}"
fi
if [ -z "$synonym" ]; then
CHROOT_SYNONYM=""
@ -302,10 +484,71 @@ if [ -r ~/.mk-sbuild.rc ]; then
. ~/.mk-sbuild.rc
fi
# Will eatmydata be available?
if [ $EATMYDATA -eq 1 ]; then
case "$RELEASE" in
hardy|lucid|maverick|lenny|squeeze)
echo "eatmydata is known not to be available in $RELEASE, ignoring --eatmydata"
EATMYDATA=0
;;
*)
DEBOOTSTRAP_INCLUDE="${DEBOOTSTRAP_INCLUDE:+$DEBOOTSTRAP_INCLUDE,}eatmydata"
;;
esac
fi
if [ $CCACHE -eq 1 ]; then
if [ -z "$CCACHE_DIR" ] || [[ "$(dirname "$CCACHE_DIR")" == '/' ]]; then
echo "Invalid ccache dir: ${CCACHE_DIR}" >&2
exit 1
fi
# We can safely use a global cache path, in such case changing size applies
# to all the schroots
setup_script="$CCACHE_DIR"/mk-sbuild-setup
if [ -d "$CCACHE_DIR" ]; then
echo "Reusing $CCACHE_DIR as CCACHE_DIR, will be configured to use max-size=${CCACHE_SIZE}"
rm -f "$setup_script"
else
echo "Configuring $CCACHE_DIR as CCACHE_DIR with max-size=${CCACHE_SIZE}"
sudo install --group=sbuild --mode=2775 -d "$CCACHE_DIR"
fi
if [ ! -x "$setup_script" ]; then
cat <<END | sudo tee "$setup_script" 1>/dev/null
#!/bin/sh
export CCACHE_DIR="$CCACHE_DIR"
export CCACHE_MAXSIZE="${CCACHE_SIZE}"
export CCACHE_UMASK=002
export CCACHE_COMPRESS=1
unset CCACHE_HARDLINK
export CCACHE_NOHARDLINK=1
export PATH="/usr/lib/ccache:\$PATH"
exec "\$@"
END
sudo chmod a+rx "$setup_script"
fi
if ! sudo grep -qs "$CCACHE_DIR" /etc/schroot/sbuild/fstab; then
# This acts on host configuration, but there is no other way to handle
# this, however it won't affect anything
cat <<END | sudo tee -a /etc/schroot/sbuild/fstab 1>/dev/null
${CCACHE_DIR} ${CCACHE_DIR} none rw,bind 0 0
END
fi
DEBOOTSTRAP_INCLUDE="${DEBOOTSTRAP_INCLUDE:+$DEBOOTSTRAP_INCLUDE,}ccache"
BUILD_PKGS="$BUILD_PKGS ccache"
COMMAND_PREFIX="${COMMAND_PREFIX:+$COMMAND_PREFIX,}$setup_script"
fi
if [ -z "$SCHROOT_TYPE" ]; then
# To build the LV, we need to know which volume group to use
if [ -n "$VG" ]; then
SCHROOT_TYPE="lvm-snapshot"
# To build the ZFS dataset, we need to know which parent to use
elif [ -n "$ZFS_PARENT_DATASET" ]; then
SCHROOT_TYPE="zfs-snapshot"
else
SCHROOT_TYPE="directory"
fi
@ -320,7 +563,11 @@ case "$SCHROOT_TYPE" in
fi
# Set up some variables for use in the paths and names
CHROOT_LV="${name}_${CHROOT_ARCH}_chroot"
if [ -z "$TARGET_ARCH" ]; then
CHROOT_LV="${name}_${CHROOT_ARCH}_chroot"
else
CHROOT_LV="${name}_${CHROOT_ARCH}_${TARGET_ARCH}_chroot"
fi
CHROOT_PATH="/dev/$VG/$CHROOT_LV"
# Install lvm2 if missing
@ -348,7 +595,7 @@ case "$SCHROOT_TYPE" in
# Set up some variables for use in the paths and names
CHROOT_PATH="${SOURCE_CHROOTS_TGZ}/${CHROOT_NAME}.tgz"
;;
"btrfs-snapshot")
"btrfs-snapshot" | "zfs-snapshot")
if [ ! -d "${SOURCE_CHROOTS_DIR}" ]; then
sudo mkdir -p "${SOURCE_CHROOTS_DIR}"
fi
@ -365,12 +612,12 @@ esac
# Is the specified release known to debootstrap?
variant_opt="--variant=buildd"
if [ ! -r "/usr/share/debootstrap/scripts/$RELEASE" ]; then
echo "Specified release ($RELEASE) not known to debootstrap" >&2
if [ ! -r "/usr/share/debootstrap/scripts/$DEBOOTSTRAP_SCRIPT" ]; then
echo "Specified release ($DEBOOTSTRAP_SCRIPT) not known to debootstrap" >&2
exit 1
fi
BUILD_PKGS="build-essential fakeroot devscripts apt-utils"
BUILD_PKGS="build-essential fakeroot apt-utils"
# Handle distro-specific logic, unknown to debootstrap
case "$DISTRO" in
ubuntu)
@ -379,21 +626,17 @@ ubuntu)
amd64 | i386)
DEBOOTSTRAP_MIRROR="http://archive.ubuntu.com/ubuntu"
;;
armel | hppa | ia64 | lpia | sparc)
*)
DEBOOTSTRAP_MIRROR="http://ports.ubuntu.com/ubuntu-ports"
;;
powerpc)
if [ "$RELEASE" != "dapper" ]; then
DEBOOTSTRAP_MIRROR="http://ports.ubuntu.com/ubuntu-ports"
else
DEBOOTSTRAP_MIRROR="http://archive.ubuntu.com/ubuntu"
fi
;;
esac
fi
if [ -z "$COMPONENTS" ]; then
COMPONENTS="main restricted universe multiverse"
fi
if [ -z "$SOURCES_PROPOSED_SUITE" ]; then
SOURCES_PROPOSED_SUITE="RELEASE-proposed"
fi
if [ -z "$SOURCES_SECURITY_SUITE" ]; then
SOURCES_SECURITY_SUITE="RELEASE-security"
fi
@ -402,47 +645,75 @@ ubuntu)
amd64 | i386)
SOURCES_SECURITY_URL="http://security.ubuntu.com/ubuntu"
;;
armel | hppa | ia64 | lpia | sparc)
*)
SOURCES_SECURITY_URL="http://ports.ubuntu.com/ubuntu-ports"
;;
powerpc)
if [ "$RELEASE" != "dapper" ]; then
SOURCES_SECURITY_URL="http://ports.ubuntu.com/ubuntu-ports"
else
SOURCES_SECURITY_URL="http://security.ubuntu.com/ubuntu"
fi
esac
fi
if [ -n "$TARGET_ARCH" ]; then
# target chroots only supported in precise and later, so ignore
# the fact that powerpc was once not on ports.
case "$TARGET_ARCH" in
amd64 | i386)
TARGET_MIRROR="http://archive.ubuntu.com/ubuntu"
TARGET_SOURCES_SECURITY_URL="http://security.ubuntu.com/ubuntu"
;;
*)
TARGET_MIRROR="http://ports.ubuntu.com/ubuntu-ports"
TARGET_SOURCES_SECURITY_URL="http://ports.ubuntu.com/ubuntu-ports"
;;
esac
fi
# Add edgy+ buildd tools
if [ "$RELEASE" != "breezy" ] && [ "$RELEASE" != "dapper" ]; then
if ubuntu_dist_ge "$RELEASE" "edgy"; then
# Add pkgbinarymangler (edgy and later)
BUILD_PKGS="$BUILD_PKGS pkgbinarymangler"
USE_PKGBINARYMANGLER=1
# Disable recommends for a smaller chroot (gutsy and later only)
BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
# Add buildd tools
BUILD_PKGS="$BUILD_PKGS pkg-create-dbgsym pkgbinarymangler"
if ubuntu_dist_ge "$RELEASE" "gutsy"; then
BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
SKIP_RECOMMENDS=1
fi
# Add pkg-create-dbgsym (edgy through zesty)
if ! ubuntu_dist_ge "$RELEASE" "artful"; then
BUILD_PKGS="$BUILD_PKGS pkg-create-dbgsym"
fi
fi
;;
debian)
if [ -z "$DEBOOTSTRAP_MIRROR" ]; then
DEBOOTSTRAP_MIRROR="http://ftp.debian.org/debian"
DEBOOTSTRAP_MIRROR="http://deb.debian.org/debian"
fi
if [ -z "$COMPONENTS" ]; then
COMPONENTS="main non-free contrib"
COMPONENTS="main non-free non-free-firmware contrib"
fi
if [ -z "$SOURCES_PROPOSED_SUITE" ]; then
SOURCES_PROPOSED_SUITE="RELEASE-proposed-updates"
fi
# Debian only performs security updates
SKIP_UPDATES=1
if [ -z "$SOURCES_SECURITY_SUITE" ]; then
SOURCES_SECURITY_SUITE="RELEASE/updates"
if debian_dist_ge "$RELEASE" "bullseye"; then
SOURCES_SECURITY_SUITE="RELEASE-security"
else
SOURCES_SECURITY_SUITE="RELEASE/updates"
fi
fi
if [ -z "$SOURCES_SECURITY_URL" ]; then
SOURCES_SECURITY_URL="http://security.debian.org/"
fi
# Unstable (aka "sid") does not have a security repository
if [ "$RELEASE" = 'unstable' ] || [ "$RELEASE" = 'sid' ]; then
if [ -n "$TARGET_ARCH" ]; then
TARGET_MIRROR="$DEBOOTSTRAP_MIRROR"
TARGET_SOURCES_SECURITY_URL="$SOURCES_SECURITY_URL"
fi
# Unstable and Experimental do not have security or proposed repositories
if [ "$RELEASE" = 'unstable' ] || [ "$RELEASE" = 'sid' ] || [ "$RELEASE" = 'experimental' ]; then
SKIP_SECURITY=1
SKIP_PROPOSED=1
fi
# Keep the chroot as minimal as possible
BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
SKIP_RECOMMENDS=1
;;
*)
echo "Unknown --distro '$DISTRO': aborting" >&2
@ -450,18 +721,41 @@ debian)
;;
esac
if [ -n "$TARGET_ARCH" ]; then
# Ultimately we would like there to be a "cross-build-essential-$arch"
# package. In practice, the cross-g++ package is sufficient to pull in
# everything we need.
if ! target_tuple=$(dpkg-architecture -a"$TARGET_ARCH" -qDEB_HOST_GNU_TYPE 2>/dev/null)
then
echo "Unknown target architecture $TARGET_ARCH" >&2
exit 1
fi
BUILD_PKGS="$BUILD_PKGS g++-$target_tuple pkg-config dpkg-cross libc-dev:$TARGET_ARCH"
fi
debootstrap_opts="--components=$(echo $COMPONENTS | tr ' ' ,)"
if [ -n "$DEBOOTSTRAP_INCLUDE" ] ; then
debootstrap_opts="--include=$DEBOOTSTRAP_INCLUDE"
debootstrap_opts="$debootstrap_opts --include=$DEBOOTSTRAP_INCLUDE"
fi
if [ -n "$DEBOOTSTRAP_EXCLUDE" ] ; then
debootstrap_opts="$debootstrap_opts --exclude=$DEBOOTSTRAP_EXCLUDE"
fi
if [ $DEBOOTSTRAP_NO_CHECK_GPG -eq 1 ]; then
debootstrap_opts="$debootstrap_opts --no-check-gpg"
elif [ -n "$DEBOOTSTRAP_KEYRING" ]; then
debootstrap_opts="$debootstrap_opts --keyring=$DEBOOTSTRAP_KEYRING"
fi
if [ -n "$DEBOOTSTRAP_OPTS" ] ; then
debootstrap_opts="$debootstrap_opts $DEBOOTSTRAP_OPTS"
fi
# if http_proxy is set in the environment (even empty) set 'proxy' to it
[ "$proxy" = "_unset_" -a "${DEBOOTSTRAP_PROXY-xx}" = "xx" ] &&
[ "$proxy" = "_unset_" -a "${DEBOOTSTRAP_PROXY-xx}" != "xx" ] &&
proxy=${DEBOOTSTRAP_PROXY}
[ "$proxy" = "_unset_" -a "${http_proxy-xx}" = "xx" ] && proxy=${http_proxy}
[ "$proxy" = "_unset_" -a "${http_proxy-xx}" != "xx" ] && proxy=${http_proxy}
if [ "$proxy" = "_unset_" ]; then
_out=$(apt-config shell x Acquire::HTTP::Proxy) &&
_out=$(sh -c 'eval $1 && echo $x' -- "$_out") && [ -n "$_out" ] &&
@ -474,12 +768,12 @@ DEBOOTSTRAP_COMMAND=debootstrap
if [ "$CHROOT_ARCH" != "$HOST_ARCH" ] ; then
case "$CHROOT_ARCH-$HOST_ARCH" in
# Sometimes we don't need qemu
amd64-i386|amd64-lpia|arm-armel|armel-arm|i386-amd64|i386-lpia|lpia-i386|powerpc-ppc64|ppc64-powerpc|sparc-sparc64|sparc64-sparc)
amd64-i386|arm64-armhf|armhf-arm64|i386-amd64|powerpc-ppc64|ppc64-powerpc)
;;
# Sometimes we do
*)
DEBOOTSTRAP_COMMAND=qemu-debootstrap
if ! which "$DEBOOTSTRAP_COMMAND"; then
DEBOOTSTRAP_COMMAND=debootstrap
if ! which "qemu-x86_64-static"; then
sudo apt-get install qemu-user-static
fi
;;
@ -512,58 +806,130 @@ case "$SCHROOT_TYPE" in
fi
sudo btrfs subvolume create "${MNT}"
;;
"zfs-snapshot")
ZFS_DATASET="${ZFS_PARENT_DATASET}/${CHROOT_NAME}"
if sudo zfs list "${ZFS_DATASET}" >/dev/null 2>&1; then
echo "E: ZFS dataset ${ZFS_DATASET} already exists; aborting" >&2
exit 1
fi
sudo zfs create -p -o mountpoint=legacy "${ZFS_DATASET}"
# Mount
MNT=`mktemp -d -t schroot-XXXXXX`
sudo mount -t zfs "${ZFS_DATASET}" "${MNT}"
;;
"file")
MNT=`mktemp -d -t schroot-XXXXXX`
esac
case "$SCHROOT_TYPE" in
directory|file)
if grep -q '\soverlay$' /proc/filesystems \
|| /sbin/modprobe -q --dry-run overlay; then
OVERLAY_FS=overlay
elif grep -q '\soverlayfs$' /proc/filesystems \
|| /sbin/modprobe -q --dry-run overlayfs; then
OVERLAY_FS=overlayfs
else
OVERLAY_FS=aufs
fi
esac
# work around apt's GPG invocation that fails without root's .gnupg directory
sudo mkdir -p -m 0700 "$MNT"/root/.gnupg
# debootstrap the chroot
sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
sudo ${proxy:+"http_proxy=${proxy}"} "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" "$DEBOOTSTRAP_SCRIPT"
if [ $EATMYDATA -eq 1 ]; then
sudo mkdir -p "${MNT}/usr/local/libexec/mk-sbuild"
sudo ln -s /usr/bin/eatmydata "${MNT}/usr/local/libexec/mk-sbuild/dpkg"
echo 'Dir::Bin::dpkg "/usr/local/libexec/mk-sbuild/dpkg";' \
| sudo tee "${MNT}/etc/apt/apt.conf.d/00mk-sbuild-eatmydata" > /dev/null
fi
# Update the package sources
TEMP_SOURCES=`mktemp -t sources-XXXXXX`
if [ -z "$TEMPLATE_SOURCES" ]; then
TEMPLATE_SOURCES=~/.mk-sbuild.sources
fi
if [ -n "$TARGET_ARCH" ]; then
MIRROR_ARCHS="[arch=$CHROOT_ARCH] "
fi
if [ -r "$TEMPLATE_SOURCES" ]; then
cat "$TEMPLATE_SOURCES" > "$TEMP_SOURCES"
else
cat > "$TEMP_SOURCES" <<EOM
deb ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS}
deb ${MIRROR_ARCHS}${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS}
deb-src ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS}
EOM
if [ -n "$TARGET_ARCH" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb [arch=$TARGET_ARCH] $TARGET_MIRROR RELEASE $COMPONENTS
EOM
fi
if [ "$EXPERIMENTAL" -eq 1 ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb ${DEBOOTSTRAP_MIRROR} experimental ${COMPONENTS}
deb ${MIRROR_ARCHS}${DEBOOTSTRAP_MIRROR} experimental ${COMPONENTS}
deb-src ${DEBOOTSTRAP_MIRROR} experimental ${COMPONENTS}
EOM
if [ -n "$TARGET_ARCH" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb [arch=$TARGET_ARCH] $TARGET_MIRROR experimental $COMPONENTS
EOM
fi
fi
if [ -z "$SKIP_UPDATES" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb ${DEBOOTSTRAP_MIRROR} RELEASE-updates ${COMPONENTS}
deb ${MIRROR_ARCHS}${DEBOOTSTRAP_MIRROR} RELEASE-updates ${COMPONENTS}
deb-src ${DEBOOTSTRAP_MIRROR} RELEASE-updates ${COMPONENTS}
EOM
if [ -n "$TARGET_ARCH" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb [arch=$TARGET_ARCH] $TARGET_MIRROR RELEASE-updates $COMPONENTS
EOM
fi
fi
if [ -z "$SKIP_PROPOSED" ]; then
TEMP_PREFERENCES=`mktemp -t preferences-XXXXXX`
cat >> "$TEMP_PREFERENCES" <<EOM
# override for NotAutomatic: yes
Package: *
Pin: release a=*-proposed
Pin-Priority: 500
EOM
cat >> "$TEMP_SOURCES" <<EOM
deb ${MIRROR_ARCHS}${DEBOOTSTRAP_MIRROR} $SOURCES_PROPOSED_SUITE ${COMPONENTS}
deb-src ${DEBOOTSTRAP_MIRROR} $SOURCES_PROPOSED_SUITE ${COMPONENTS}
EOM
if [ -n "$TARGET_ARCH" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb [arch=$TARGET_ARCH] $TARGET_MIRROR $SOURCES_PROPOSED_SUITE $COMPONENTS
EOM
fi
fi
if [ -z "$SKIP_SECURITY" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb ${SOURCES_SECURITY_URL} ${SOURCES_SECURITY_SUITE} ${COMPONENTS}
deb ${MIRROR_ARCHS}${SOURCES_SECURITY_URL} ${SOURCES_SECURITY_SUITE} ${COMPONENTS}
deb-src ${SOURCES_SECURITY_URL} ${SOURCES_SECURITY_SUITE} ${COMPONENTS}
EOM
if [ -n "$TARGET_ARCH" ]; then
cat >> "$TEMP_SOURCES" <<EOM
deb [arch=$TARGET_ARCH] $TARGET_SOURCES_SECURITY_URL $SOURCES_SECURITY_SUITE $COMPONENTS
EOM
fi
fi
fi
cat "$TEMP_SOURCES" | sed -e "s|RELEASE|$RELEASE|g" | \
sudo bash -c "cat > $MNT/etc/apt/sources.list"
rm -f "$TEMP_SOURCES"
if [ "$EXPERIMENTAL" -eq 1 ]; then
echo 'APT::Default-Release "experimental";' \
| sudo tee "$MNT"/etc/apt/apt.conf.d/15sbuild > /dev/null
if [ -n "$TEMP_PREFERENCES" ]; then
sudo mv "$TEMP_PREFERENCES" $MNT/etc/apt/preferences.d/proposed.pref
fi
# Copy the timezone (comment this out if you want to leave the chroot at UTC)
sudo cp /etc/localtime /etc/timezone "$MNT"/etc/
# Copy the timezone (uncomment this if you want to use your local time zone)
#sudo cp -P --remove-destination /etc/localtime /etc/timezone "$MNT"/etc/
# Create a schroot entry for this chroot
TEMP_SCHROOTCONF=`mktemp -t schrootconf-XXXXXX`
TEMPLATE_SCHROOTCONF=~/.mk-sbuild.schroot.conf
@ -588,7 +954,13 @@ root-groups=$ADMIN_GROUPS
#source-root-users=$ADMIN_GROUPS
#source-root-groups=$ADMIN_GROUPS
type=SCHROOT_TYPE
profile=$SCHROOT_PROFILE
EOM
if [ -n "$COMMAND_PREFIX" ]; then
cat >> "$TEMP_SCHROOTCONF" <<EOM
command-prefix=${COMMAND_PREFIX}
EOM
fi
case "$SCHROOT_TYPE" in
"lvm-snapshot")
cat >> "$TEMP_SCHROOTCONF" <<EOM
@ -599,7 +971,7 @@ EOM
;;
directory|file)
cat >> "${TEMP_SCHROOTCONF}" <<EOM
union-type=aufs
union-type=$OVERLAY_FS
${SCHROOT_TYPE}=CHROOT_PATH
EOM
;;
@ -609,6 +981,12 @@ btrfs-source-subvolume=CHROOT_PATH
btrfs-snapshot-directory=CHROOT_SNAPSHOT_DIR
EOM
;;
zfs-snapshot)
cat >> "${TEMP_SCHROOTCONF}" <<EOM
zfs-dataset=ZFS_DATASET
EOM
;;
esac
fi
if [ ! -z "$personality" ]; then
@ -625,6 +1003,7 @@ sed -e "s|CHROOT_NAME|$CHROOT_NAME|g" \
-e "s|SNAPSHOT_SIZE|$SNAPSHOT_SIZE|g" \
-e "s|SCHROOT_TYPE|$SCHROOT_TYPE|g" \
-e "s|CHROOT_SNAPSHOT_DIR|$CHROOT_SNAPSHOT_DIR|g" \
-e "s|ZFS_DATASET|$ZFS_DATASET|g" \
"$TEMP_SCHROOTCONF" \
| sudo tee "/etc/schroot/chroot.d/sbuild-$CHROOT_NAME" > /dev/null
rm -f "$TEMP_SCHROOTCONF"
@ -646,15 +1025,56 @@ sudo chmod a+x "$MNT"/usr/sbin/policy-rc.d
# Create image finalization script
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
#!/bin/bash
#set -x
if [ "$DEBUG" = 1 ]; then
set -x
fi
set -e
if [ -n "$proxy" ]; then
mkdir -p /etc/apt/apt.conf.d/
cat > /etc/apt/apt.conf.d/99mk-sbuild-proxy <<EOF
## proxy settings copied from mk-sbuild
// proxy settings copied from mk-sbuild
Acquire { HTTP { Proxy "$proxy"; }; };
EOF
fi
EOM
if [ -n "$SKIP_RECOMMENDS" ]; then
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
mkdir -p /etc/apt/apt.conf.d/
cat > /etc/apt/apt.conf.d/99mk-sbuild-no-recommends <<EOF
// disable install recommends
APT::Install-Recommends "0";
EOF
EOM
fi
if [ "$USE_PKGBINARYMANGLER" = 1 ]; then
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
mkdir -p /etc/pkgbinarymangler/
cat > /etc/pkgbinarymangler/maintainermangler.conf <<EOF
# pkgmaintainermangler configuration file
# pkgmaintainermangler will do nothing unless enable is set to "true"
enable: true
# Configure what happens if /CurrentlyBuilding is present, but invalid
# (i. e. it does not contain a Package: field). If "ignore" (default),
# the file is ignored (i. e. the Maintainer field is mangled) and a
# warning is printed. If "fail" (or any other value), pkgmaintainermangler
# exits with an error, which causes a package build to fail.
invalid_currentlybuilding: ignore
EOF
EOM
fi
if [ -n "$TARGET_ARCH" ]; then
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
# Configure target architecture
dpkg --add-architecture "$TARGET_ARCH"
EOM
fi
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
# Reload package lists
apt-get update || true
# Pull down signature requirements
@ -665,7 +1085,7 @@ apt-get update || true
echo set debconf/frontend Noninteractive | debconf-communicate
echo set debconf/priority critical | debconf-communicate
# Install basic build tool set, trying to match buildd
apt-get -y --force-yes install $BUILD_PKGS
apt-get -y --force-yes -o Dpkg::Options::="--force-confold" install $BUILD_PKGS
# Set up expected /dev entries
if [ ! -r /dev/stdin ]; then ln -s /proc/self/fd/0 /dev/stdin; fi
if [ ! -r /dev/stdout ]; then ln -s /proc/self/fd/1 /dev/stdout; fi
@ -677,7 +1097,7 @@ EOM
sudo chmod a+x "$MNT"/finish.sh
case "$SCHROOT_TYPE" in
"lvm-snapshot")
"lvm-snapshot"|"zfs-snapshot")
sudo umount "$MNT"
rmdir "$MNT"
;;
@ -692,15 +1112,18 @@ case "$SCHROOT_TYPE" in
esac
# Run finalization script on the "golden" copy via schroot.
sudo schroot -c "$CHROOT_NAME"-source -u root /finish.sh
sudo schroot -c source:$CHROOT_NAME -u root /finish.sh
# Finished
echo ""
echo "Done building $CHROOT_NAME."
echo ""
echo " To CHANGE the golden image: sudo schroot -c ${CHROOT_NAME}-source -u root"
echo " To CHANGE the golden image: sudo schroot -c source:${CHROOT_NAME} -u root"
echo " To ENTER an image snapshot: schroot -c ${CHROOT_NAME}"
echo " To BUILD within a snapshot: sbuild -A -d ${CHROOT_NAME} PACKAGE*.dsc"
if [ -n "$TARGET_ARCH" ] && [ "$CHROOT_ARCH" != "$TARGET_ARCH" ] ; then
echo " To BUILD for ${TARGET_ARCH}: sbuild -A -d ${CHROOT_NAME} --host ${TARGET_ARCH} PACKAGE*.dsc"
fi
echo ""
# vi: set et:

View File

@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2010, Siegfried-A. Gevatter <rainct@ubuntu.com>,
@ -29,14 +29,27 @@
# configurations. For example, a symlink called pbuilder-hardy will assume
# that the target distribution is always meant to be Ubuntu Hardy.
import os
import sys
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from devscripts.logger import Logger
from distro_info import DebianDistroInfo
import os
import os.path
import shutil
import subprocess
import sys
from contextlib import suppress
import debian.deb822
from distro_info import DebianDistroInfo, DistroDataOutdated, UbuntuDistroInfo
import ubuntutools.misc
from ubuntutools import subprocess
import ubuntutools.version
from ubuntutools import getLogger
from ubuntutools.config import UDTConfig
from ubuntutools.question import YesNoQuestion
Logger = getLogger()
class PbuilderDist:
def __init__(self, builder):
@ -51,6 +64,12 @@ class PbuilderDist:
# and 'non-free' for Debian.
self.extra_components = True
# Extra pockets, useful on stable releases
self.enable_security = True
self.enable_updates = True
self.enable_proposed = True
self.enable_backports = False
# File where the log of the last operation will be saved.
self.logfile = None
@ -71,32 +90,36 @@ class PbuilderDist:
self.chroot_string = None
# Authentication method
self.auth = 'sudo'
self.auth = "sudo"
# Builder
self.builder = builder
self._debian_distros = DebianDistroInfo().all + \
['stable', 'testing', 'unstable']
# Distro info
self.debian_distro_info = DebianDistroInfo()
self.ubuntu_distro_info = UbuntuDistroInfo()
self._debian_distros = self.debian_distro_info.all + ["stable", "testing", "unstable"]
# Ensure that the used builder is installed
paths = set(os.environ['PATH'].split(':'))
paths |= set(('/sbin', '/usr/sbin', '/usr/local/sbin'))
paths = set(os.environ["PATH"].split(":"))
paths |= set(("/sbin", "/usr/sbin", "/usr/local/sbin"))
if not any(os.path.exists(os.path.join(p, builder)) for p in paths):
Logger.error('Could not find "%s".', builder)
sys.exit(1)
##############################################################
self.base = os.path.expanduser(os.environ.get('PBUILDFOLDER',
'~/pbuilder/'))
self.base = os.path.expanduser(os.environ.get("PBUILDFOLDER", "~/pbuilder/"))
if 'SUDO_USER' in os.environ:
Logger.warn('Running under sudo. '
'This is probably not what you want. '
'pbuilder-dist will use sudo itself, when necessary.')
if os.stat(os.environ['HOME']).st_uid != os.getuid():
if "SUDO_USER" in os.environ:
Logger.warning(
"Running under sudo. "
"This is probably not what you want. "
"pbuilder-dist will use sudo itself, "
"when necessary."
)
if os.stat(os.environ["HOME"]).st_uid != os.getuid():
Logger.error("You don't own $HOME")
sys.exit(1)
@ -107,8 +130,8 @@ class PbuilderDist:
Logger.error('Cannot create base directory "%s"', self.base)
sys.exit(1)
if 'PBUILDAUTH' in os.environ:
self.auth = os.environ['PBUILDAUTH']
if "PBUILDAUTH" in os.environ:
self.auth = os.environ["PBUILDAUTH"]
self.system_architecture = ubuntutools.misc.host_architecture()
self.system_distro = ubuntutools.misc.system_distribution()
@ -118,7 +141,7 @@ class PbuilderDist:
self.target_distro = self.system_distro
def set_target_distro(self, distro):
""" PbuilderDist.set_target_distro(distro) -> None
"""PbuilderDist.set_target_distro(distro) -> None
Check if the given target distribution name is correct, if it
isn't know to the system ask the user for confirmation before
@ -129,15 +152,17 @@ class PbuilderDist:
Logger.error('"%s" is an invalid distribution codename.', distro)
sys.exit(1)
if not os.path.isfile(os.path.join('/usr/share/debootstrap/scripts/',
distro)):
if os.path.isdir('/usr/share/debootstrap/scripts/'):
if not os.path.isfile(os.path.join("/usr/share/debootstrap/scripts/", distro)):
if os.path.isdir("/usr/share/debootstrap/scripts/"):
# Debian experimental doesn't have a debootstrap file but
# should work nevertheless.
if distro not in self._debian_distros:
answer = ask(('Warning: Unknown distribution "%s". Do you '
'want to continue [y/N]? ') % distro)
if answer not in ('y', 'Y'):
# should work nevertheless. Ubuntu releases automatically use
# the gutsy script as of debootstrap 1.0.128+nmu2ubuntu1.1.
if distro not in (self._debian_distros + self.ubuntu_distro_info.all):
question = (
f'Warning: Unknown distribution "{distro}". ' "Do you want to continue"
)
answer = YesNoQuestion().ask(question, "no")
if answer == "no":
sys.exit(0)
else:
Logger.error('Please install package "debootstrap".')
@ -146,55 +171,72 @@ class PbuilderDist:
self.target_distro = distro
def set_operation(self, operation):
""" PbuilderDist.set_operation -> None
"""PbuilderDist.set_operation -> None
Check if the given string is a valid pbuilder operation and
depending on this either save it into the appropiate variable
or finalize pbuilder-dist's execution.
"""
arguments = ('create', 'update', 'build', 'clean', 'login', 'execute')
arguments = ("create", "update", "build", "clean", "login", "execute")
if operation not in arguments:
if operation.endswith('.dsc'):
if operation.endswith(".dsc"):
if os.path.isfile(operation):
self.operation = 'build'
self.operation = "build"
return [operation]
else:
Logger.error('Could not find file "%s".', operation)
sys.exit(1)
else:
Logger.error('"%s" is not a recognized argument.\n'
'Please use one of these: %s.',
operation, ', '.join(arguments))
Logger.error('Could not find file "%s".', operation)
sys.exit(1)
else:
self.operation = operation
return []
def get_command(self, remaining_arguments = None):
""" PbuilderDist.get_command -> string
Logger.error(
'"%s" is not a recognized argument.\nPlease use one of these: %s.',
operation,
", ".join(arguments),
)
sys.exit(1)
self.operation = operation
return []
def get_command(self, remaining_arguments=None):
"""PbuilderDist.get_command -> string
Generate the pbuilder command which matches the given configuration
and return it as a string.
"""
if not self.build_architecture:
self.chroot_string = self.target_distro
self.build_architecture = self.system_architecture
if self.build_architecture == self.system_architecture:
self.chroot_string = self.target_distro
else:
self.chroot_string = (self.target_distro + '-'
+ self.build_architecture)
self.chroot_string = self.target_distro + "-" + self.build_architecture
prefix = os.path.join(self.base, self.chroot_string)
if '--buildresult' not in remaining_arguments:
result = '%s_result/' % prefix
if "--buildresult" not in remaining_arguments:
result = os.path.normpath(f"{prefix}_result/")
else:
location_of_arg = remaining_arguments.index('--buildresult')
result = remaining_arguments[location_of_arg+1]
remaining_arguments.pop(location_of_arg+1)
location_of_arg = remaining_arguments.index("--buildresult")
result = os.path.normpath(remaining_arguments[location_of_arg + 1])
remaining_arguments.pop(location_of_arg + 1)
remaining_arguments.pop(location_of_arg)
if not self.logfile and self.operation != 'login':
self.logfile = os.path.normpath('%s/last_operation.log' % result)
if not self.logfile and self.operation != "login":
if self.operation == "build":
dsc_files = [a for a in remaining_arguments if a.strip().endswith(".dsc")]
assert len(dsc_files) == 1
dsc = debian.deb822.Dsc(open(dsc_files[0], encoding="utf-8"))
version = ubuntutools.version.Version(dsc["Version"])
name = (
dsc["Source"]
+ "_"
+ version.strip_epoch()
+ "_"
+ self.build_architecture
+ ".build"
)
self.logfile = os.path.join(result, name)
else:
self.logfile = os.path.join(result, "last_operation.log")
if not os.path.isdir(result):
try:
@ -204,84 +246,151 @@ class PbuilderDist:
sys.exit(1)
arguments = [
'--%s' % self.operation,
'--distribution', self.target_distro,
'--buildresult', result,
'--aptcache', '/var/cache/apt/archives/',
'--override-config',
f"--{self.operation}",
"--distribution",
self.target_distro,
"--buildresult",
result,
]
if self.builder == 'pbuilder':
arguments += ['--basetgz', prefix + '-base.tgz']
elif self.builder == 'cowbuilder':
arguments += ['--basepath', prefix + '-base.cow']
if self.operation == "update":
arguments += ["--override-config"]
if self.builder == "pbuilder":
arguments += ["--basetgz", prefix + "-base.tgz"]
elif self.builder == "cowbuilder":
arguments += ["--basepath", prefix + "-base.cow"]
else:
Logger.error('Unrecognized builder "%s".', self.builder)
sys.exit(1)
if self.logfile:
arguments += ['--logfile', self.logfile]
arguments += ["--logfile", self.logfile]
if os.path.exists('/var/cache/archive/'):
arguments += ['--bindmounts', '/var/cache/archive/']
if os.path.exists("/var/cache/archive/"):
arguments += ["--bindmounts", "/var/cache/archive/"]
localrepo = '/var/cache/archive/' + self.target_distro
config = UDTConfig()
if self.target_distro in self._debian_distros:
mirror = os.environ.get("MIRRORSITE", config.get_value("DEBIAN_MIRROR"))
components = "main"
if self.extra_components:
components += " contrib non-free non-free-firmware"
else:
mirror = os.environ.get("MIRRORSITE", config.get_value("UBUNTU_MIRROR"))
if self.build_architecture not in ("amd64", "i386"):
mirror = os.environ.get("MIRRORSITE", config.get_value("UBUNTU_PORTS_MIRROR"))
components = "main restricted"
if self.extra_components:
components += " universe multiverse"
arguments += ["--mirror", mirror]
othermirrors = []
localrepo = f"/var/cache/archive/{self.target_distro}"
if os.path.exists(localrepo):
arguments += [
'--othermirror',
'deb file:///var/cache/archive/ %s/' % self.target_distro,
]
repo = f"deb file:///var/cache/archive/ {self.target_distro}/"
othermirrors.append(repo)
if self.target_distro in self._debian_distros:
arguments += ['--mirror', 'http://ftp.debian.org/debian']
components = 'main'
if self.extra_components:
components += ' contrib non-free'
try:
codename = self.debian_distro_info.codename(
self.target_distro, default=self.target_distro
)
except DistroDataOutdated as error:
Logger.warning(error)
if codename in (self.debian_distro_info.devel(), "experimental"):
self.enable_security = False
self.enable_updates = False
self.enable_proposed = False
elif codename in (self.debian_distro_info.testing(), "testing"):
self.enable_updates = False
if self.enable_security:
pocket = "-security"
with suppress(ValueError):
# before bullseye (version 11) security suite is /updates
if float(self.debian_distro_info.version(codename)) < 11.0:
pocket = "/updates"
othermirrors.append(
f"deb {config.get_value('DEBSEC_MIRROR')}"
f" {self.target_distro}{pocket} {components}"
)
if self.enable_updates:
othermirrors.append(f"deb {mirror} {self.target_distro}-updates {components}")
if self.enable_proposed:
othermirrors.append(
f"deb {mirror} {self.target_distro}-proposed-updates {components}"
)
if self.enable_backports:
othermirrors.append(f"deb {mirror} {self.target_distro}-backports {components}")
aptcache = os.path.join(self.base, "aptcache", "debian")
else:
if self.build_architecture in ('amd64', 'i386'):
arguments += ['--mirror', 'http://archive.ubuntu.com/ubuntu/']
elif (self.build_architecture == 'powerpc'
and self.target_distro == 'dapper'):
arguments += ['--mirror', 'http://archive.ubuntu.com/ubuntu/']
else:
arguments += ['--mirror',
'http://ports.ubuntu.com/ubuntu-ports/']
components = 'main restricted'
if self.extra_components:
components += ' universe multiverse'
try:
dev_release = self.target_distro == self.ubuntu_distro_info.devel()
except DistroDataOutdated as error:
Logger.warning(error)
dev_release = True
if dev_release:
self.enable_security = False
self.enable_updates = False
if self.enable_security:
othermirrors.append(f"deb {mirror} {self.target_distro}-security {components}")
if self.enable_updates:
othermirrors.append(f"deb {mirror} {self.target_distro}-updates {components}")
if self.enable_proposed:
othermirrors.append(f"deb {mirror} {self.target_distro}-proposed {components}")
aptcache = os.path.join(self.base, "aptcache", "ubuntu")
if "OTHERMIRROR" in os.environ:
othermirrors += os.environ["OTHERMIRROR"].split("|")
if othermirrors:
arguments += ["--othermirror", "|".join(othermirrors)]
# Work around LP:#599695
if (ubuntutools.misc.system_distribution() == 'Debian'
and self.target_distro not in self._debian_distros):
if not os.path.exists(
'/usr/share/keyrings/ubuntu-archive-keyring.gpg'):
Logger.error('ubuntu-keyring not installed')
if (
ubuntutools.misc.system_distribution() == "Debian"
and self.target_distro not in self._debian_distros
):
if not os.path.exists("/usr/share/keyrings/ubuntu-archive-keyring.gpg"):
Logger.error("ubuntu-keyring not installed")
sys.exit(1)
arguments += [
'--debootstrapopts',
'--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg',
"--debootstrapopts",
"--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg",
]
elif (ubuntutools.misc.system_distribution() == 'Ubuntu'
and self.target_distro in self._debian_distros):
if not os.path.exists(
'/usr/share/keyrings/debian-archive-keyring.gpg'):
Logger.error('debian-archive-keyring not installed')
elif (
ubuntutools.misc.system_distribution() == "Ubuntu"
and self.target_distro in self._debian_distros
):
if not os.path.exists("/usr/share/keyrings/debian-archive-keyring.gpg"):
Logger.error("debian-archive-keyring not installed")
sys.exit(1)
arguments += [
'--debootstrapopts',
'--keyring=/usr/share/keyrings/debian-archive-keyring.gpg',
"--debootstrapopts",
"--keyring=/usr/share/keyrings/debian-archive-keyring.gpg",
]
arguments += ['--components', components]
arguments += ["--aptcache", aptcache, "--components", components]
if not os.path.isdir(aptcache):
try:
os.makedirs(aptcache)
except OSError:
Logger.error('Cannot create aptcache directory "%s"', aptcache)
sys.exit(1)
if self.build_architecture != self.system_architecture:
arguments += ['--debootstrapopts',
'--arch=' + self.build_architecture]
arguments += ["--debootstrapopts", "--arch=" + self.build_architecture]
apt_conf_dir = os.path.join(self.base,
'etc/%s/apt.conf' % self.target_distro)
apt_conf_dir = os.path.join(self.base, f"etc/{self.target_distro}/apt.conf")
if os.path.exists(apt_conf_dir):
arguments += ['--aptconfdir', apt_conf_dir]
arguments += ["--aptconfdir", apt_conf_dir]
# Append remaining arguments
if remaining_arguments:
@ -289,41 +398,31 @@ class PbuilderDist:
# Export the distribution and architecture information to the
# environment so that it is accessible to ~/.pbuilderrc (LP: #628933).
# With both common variable name schemes (BTS: #659060).
return [
self.auth,
'HOME=' + os.path.expanduser('~'),
'ARCH=' + self.build_architecture,
'DIST=' + self.target_distro,
"HOME=" + os.path.expanduser("~"),
"ARCHITECTURE=" + self.build_architecture,
"DISTRIBUTION=" + self.target_distro,
"ARCH=" + self.build_architecture,
"DIST=" + self.target_distro,
"DEB_BUILD_OPTIONS=" + os.environ.get("DEB_BUILD_OPTIONS", ""),
self.builder,
] + arguments
def ask(question):
""" ask(question) -> string
Ask the given question and return the answer. Also catch
KeyboardInterrupt (Ctrl+C) and EOFError (Ctrl+D) exceptions and
immediately return None if one of those is found.
"""
try:
answer = raw_input(question)
except (KeyboardInterrupt, EOFError):
print
answer = None
return answer
def show_help(exit_code = 0):
""" help() -> None
def show_help(exit_code=0):
"""help() -> None
Print a help message for pbuilder-dist, and exit with the given code.
"""
print 'See man pbuilder-dist for more information.'
Logger.info("See man pbuilder-dist for more information.")
sys.exit(exit_code)
def main():
""" main() -> None
"""main() -> None
This is pbuilder-dist's main function. It creates a PbuilderDist
object, modifies all necessary settings taking data from the
@ -331,79 +430,122 @@ def main():
the script and runs pbuilder itself or exists with an error message.
"""
script_name = os.path.basename(sys.argv[0])
parts = script_name.split('-')
parts = script_name.split("-")
# Copy arguments into another list for save manipulation
args = sys.argv[1:]
if ('-' in script_name and parts[0] not in ('pbuilder', 'cowbuilder')
or len(parts) > 3):
Logger.error('"%s" is not a valid name for a "pbuilder-dist" '
'executable.', script_name)
if "-" in script_name and parts[0] not in ("pbuilder", "cowbuilder") or len(parts) > 3:
Logger.error('"%s" is not a valid name for a "pbuilder-dist" executable.', script_name)
sys.exit(1)
if len(args) < 1:
Logger.error('Insufficient number of arguments.')
Logger.error("Insufficient number of arguments.")
show_help(1)
if args[0] in ('-h', '--help', 'help'):
if args[0] in ("-h", "--help", "help"):
show_help(0)
app = PbuilderDist(parts[0])
if len(parts) > 1 and parts[1] != 'dist' and '.' not in parts[1]:
if len(parts) > 1 and parts[1] != "dist" and "." not in parts[1]:
app.set_target_distro(parts[1])
else:
app.set_target_distro(args.pop(0))
if len(parts) > 2:
requested_arch = parts[2]
elif len(args) > 0 and args[0] in (
'alpha', 'amd64', 'arm', 'armeb', 'armel', 'i386', 'lpia', 'm68k',
'mips', 'mipsel', 'powerpc', 'ppc64', 'sh4', 'sh4eb', 'sparc',
'sparc64'):
requested_arch = args.pop(0)
elif len(args) > 0:
if shutil.which("arch-test") is not None:
arch_test = subprocess.run(
["arch-test", args[0]], check=False, stdout=subprocess.DEVNULL
)
if arch_test.returncode == 0:
requested_arch = args.pop(0)
elif os.path.isdir("/usr/lib/arch-test") and args[0] in os.listdir(
"/usr/lib/arch-test/"
):
Logger.error(
'Architecture "%s" is not supported on your '
"currently running kernel. Consider installing "
"the qemu-user-static package to enable the use of "
"foreign architectures.",
args[0],
)
sys.exit(1)
else:
requested_arch = None
else:
Logger.error(
'Cannot determine if "%s" is a valid architecture. '
"Please install the arch-test package and retry.",
args[0],
)
sys.exit(1)
else:
requested_arch = None
if requested_arch:
app.build_architecture = requested_arch
# For some foreign architectures we need to use qemu
if (requested_arch != app.system_architecture
and (app.system_architecture, requested_arch) not in [
('amd64', 'i386'), ('amd64', 'lpia'), ('arm', 'armel'),
('armel', 'arm'), ('i386', 'lpia'), ('lpia', 'i386'),
('powerpc', 'ppc64'), ('ppc64', 'powerpc'),
('sparc', 'sparc64'), ('sparc64', 'sparc')]):
args += ['--debootstrap', 'qemu-debootstrap']
if requested_arch != app.system_architecture and (
app.system_architecture,
requested_arch,
) not in [
("amd64", "i386"),
("arm64", "arm"),
("arm64", "armhf"),
("powerpc", "ppc64"),
("ppc64", "powerpc"),
]:
args += ["--debootstrap", "debootstrap"]
if 'mainonly' in sys.argv or '--main-only' in sys.argv:
if "mainonly" in sys.argv or "--main-only" in sys.argv:
app.extra_components = False
if 'mainonly' in sys.argv:
args.remove('mainonly')
if "mainonly" in sys.argv:
args.remove("mainonly")
else:
args.remove('--main-only')
args.remove("--main-only")
if "--release-only" in sys.argv:
args.remove("--release-only")
app.enable_security = False
app.enable_updates = False
app.enable_proposed = False
elif "--security-only" in sys.argv:
args.remove("--security-only")
app.enable_updates = False
app.enable_proposed = False
elif "--updates-only" in sys.argv:
args.remove("--updates-only")
app.enable_proposed = False
elif "--backports" in sys.argv:
args.remove("--backports")
app.enable_backports = True
if len(args) < 1:
Logger.error('Insufficient number of arguments.')
Logger.error("Insufficient number of arguments.")
show_help(1)
# Parse the operation
args = app.set_operation(args.pop(0)) + args
if app.operation == 'build' and '.dsc' not in ' '.join(args):
Logger.error('You have to specify a .dsc file if you want to build.')
sys.exit(1)
if app.operation == "build":
if len([a for a in args if a.strip().endswith(".dsc")]) != 1:
msg = "You have to specify one .dsc file if you want to build."
Logger.error(msg)
sys.exit(1)
# Execute the pbuilder command
if not '--debug-echo' in args:
if "--debug-echo" not in args:
sys.exit(subprocess.call(app.get_command(args)))
else:
print app.get_command([arg for arg in args if arg != '--debug-echo'])
Logger.info(app.get_command([arg for arg in args if arg != "--debug-echo"]))
if __name__ == '__main__':
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
Logger.error('Manually aborted.')
Logger.error("Manually aborted.")
sys.exit(1)

View File

@ -30,29 +30,44 @@ OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
usage() {
prog=$(basename $0)
cat <<EOF
Usage: $prog command [pbuilder-options...]
A simple multi-release pbuilder wrapper
Valid commands are:
create
update
build
clean
login
execute
Options:
-h, --help show this help message and exit
EOF
exit $1
}
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
create|update|build|clean|login|execute)
;;
-h|--help)
usage 0
;;
*)
usage 1
;;
esac
if [ $PROCEED = true ]; then
shift
if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ]
then mkdir -p $BASE_DIR/${DISTRIBUTION}_result/
fi
sudo pbuilder $OPERATION \
--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
--distribution $DISTRIBUTION \
--buildresult $BASE_DIR/$DISTRIBUTION_result \
--othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse" $@
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
shift
if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ]; then
mkdir -p $BASE_DIR/${DISTRIBUTION}_result/
fi
sudo pbuilder $OPERATION \
--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
--distribution $DISTRIBUTION \
--buildresult $BASE_DIR/$DISTRIBUTION_result \
--othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse" "$@"

142
pm-helper Executable file
View File

@ -0,0 +1,142 @@
#!/usr/bin/python3
# Find the next thing to work on for proposed-migration
# Copyright (C) 2023 Canonical Ltd.
# Author: Steve Langasek <steve.langasek@ubuntu.com>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License, version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import lzma
import sys
import webbrowser
from argparse import ArgumentParser
import yaml
from launchpadlib.launchpad import Launchpad
from ubuntutools.utils import get_url
# proposed-migration is only concerned with the devel series; unlike other
# tools, don't make this configurable
excuses_url = "https://ubuntu-archive-team.ubuntu.com/proposed-migration/update_excuses.yaml.xz"
def get_proposed_version(excuses, package):
for k in excuses["sources"]:
if k["source"] == package:
return k.get("new-version")
return None
def claim_excuses_bug(launchpad, bug, package):
print(f"LP: #{bug.id}: {bug.title}")
ubuntu = launchpad.distributions["ubuntu"]
series = ubuntu.current_series.fullseriesname
for task in bug.bug_tasks:
# targeting to a series doesn't make the default task disappear,
# it just makes it useless
if task.bug_target_name == f"{package} ({series})":
our_task = task
break
if task.bug_target_name == f"{package} (Ubuntu)":
our_task = task
if our_task.assignee == launchpad.me:
print("Bug already assigned to you.")
return True
if our_task.assignee:
print(f"Currently assigned to {our_task.assignee.name}")
print("""Do you want to claim this bug? [yN] """, end="")
sys.stdout.flush()
response = sys.stdin.readline()
if response.strip().lower().startswith("y"):
our_task.assignee = launchpad.me
our_task.lp_save()
return True
return False
def create_excuses_bug(launchpad, package, version):
print("Will open a new bug")
bug = launchpad.bugs.createBug(
title=f"proposed-migration for {package} {version}",
tags=("update-excuse"),
target=f"https://api.launchpad.net/devel/ubuntu/+source/{package}",
description=f"{package} {version} is stuck in -proposed.",
)
task = bug.bug_tasks[0]
task.assignee = launchpad.me
task.lp_save()
print(f"Opening {bug.web_link} in browser")
webbrowser.open(bug.web_link)
return bug
def has_excuses_bugs(launchpad, package):
ubuntu = launchpad.distributions["ubuntu"]
pkg = ubuntu.getSourcePackage(name=package)
if not pkg:
raise ValueError(f"No such source package: {package}")
tasks = pkg.searchTasks(tags=["update-excuse"], order_by=["id"])
bugs = [task.bug for task in tasks]
if not bugs:
return False
if len(bugs) == 1:
print(f"There is 1 open update-excuse bug against {package}")
else:
print(f"There are {len(bugs)} open update-excuse bugs against {package}")
for bug in bugs:
if claim_excuses_bug(launchpad, bug, package):
return True
return True
def main():
parser = ArgumentParser()
parser.add_argument("-l", "--launchpad", dest="launchpad_instance", default="production")
parser.add_argument(
"-v", "--verbose", default=False, action="store_true", help="be more verbose"
)
parser.add_argument("package", nargs="?", help="act on this package only")
args = parser.parse_args()
args.launchpad = Launchpad.login_with("pm-helper", args.launchpad_instance, version="devel")
f = get_url(excuses_url, False)
with lzma.open(f) as lzma_f:
excuses = yaml.load(lzma_f, Loader=yaml.CSafeLoader)
if args.package:
try:
if not has_excuses_bugs(args.launchpad, args.package):
proposed_version = get_proposed_version(excuses, args.package)
if not proposed_version:
print(f"Package {args.package} not found in -proposed.")
sys.exit(1)
create_excuses_bug(args.launchpad, args.package, proposed_version)
except ValueError as e:
sys.stderr.write(f"{e}\n")
else:
pass # for now
if __name__ == "__main__":
sys.exit(main())

14
pull-debian-ddebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-debian-ddebs -- pull ddeb package files for debian
# Basic usage: pull-debian-ddebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="debian", pull="ddebs")

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# pull-debian-debdiff - find and download a specific version of a Debian
# package and its immediate parent to generate a debdiff.
#
@ -17,97 +17,112 @@
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
import optparse
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import argparse
import sys
import debian.debian_support
import debian.changelog
from devscripts.logger import Logger
from ubuntutools import getLogger
from ubuntutools.archive import DebianSourcePackage, DownloadError
from ubuntutools.config import UDTConfig
from ubuntutools.version import Version
Logger = getLogger()
def previous_version(package, version, distance):
"Given an (extracted) package, determine the version distance versions ago"
upver = debian.debian_support.Version(version).upstream_version
filename = '%s-%s/debian/changelog' % (package, upver)
changelog_file = open(filename, 'r')
upver = Version(version).upstream_version
filename = f"{package}-{upver}/debian/changelog"
changelog_file = open(filename, "r", encoding="utf-8")
changelog = debian.changelog.Changelog(changelog_file.read())
changelog_file.close()
seen = 0
for entry in changelog:
if entry.distributions == 'UNRELEASED':
if entry.distributions == "UNRELEASED":
continue
if seen == distance:
return entry.version.full_version
seen += 1
return False
def main():
parser = optparse.OptionParser('%prog [options] <package> <version> '
'[distance]')
parser.add_option('-f', '--fetch',
dest='fetch_only', default=False, action='store_true',
help="Only fetch the source packages, don't diff.")
parser.add_option('-d', '--debian-mirror', metavar='DEBIAN_MIRROR',
dest='debian_mirror',
help='Preferred Debian mirror '
'(default: http://ftp.debian.org/debian)')
parser.add_option('-s', '--debsec-mirror', metavar='DEBSEC_MIRROR',
dest='debsec_mirror',
help='Preferred Debian Security mirror '
'(default: http://security.debian.org)')
parser.add_option('--no-conf',
dest='no_conf', default=False, action='store_true',
help="Don't read config files or environment variables")
parser = argparse.ArgumentParser(usage="%(prog)s [options] <package> <version> [distance]")
parser.add_argument(
"-f",
"--fetch",
dest="fetch_only",
default=False,
action="store_true",
help="Only fetch the source packages, don't diff.",
)
parser.add_argument(
"-d",
"--debian-mirror",
metavar="DEBIAN_MIRROR",
dest="debian_mirror",
help="Preferred Debian mirror (default: http://deb.debian.org/debian)",
)
parser.add_argument(
"-s",
"--debsec-mirror",
metavar="DEBSEC_MIRROR",
dest="debsec_mirror",
help="Preferred Debian Security mirror (default: http://security.debian.org)",
)
parser.add_argument(
"--no-conf",
dest="no_conf",
default=False,
action="store_true",
help="Don't read config files or environment variables",
)
parser.add_argument("package", help=argparse.SUPPRESS)
parser.add_argument("version", help=argparse.SUPPRESS)
parser.add_argument("distance", default=1, type=int, nargs="?", help=argparse.SUPPRESS)
args = parser.parse_args()
opts, args = parser.parse_args()
if len(args) < 2:
parser.error('Must specify package and version')
elif len(args) > 3:
parser.error('Too many arguments')
package = args[0]
version = args[1]
distance = int(args[2]) if len(args) > 2 else 1
config = UDTConfig(args.no_conf)
if args.debian_mirror is None:
args.debian_mirror = config.get_value("DEBIAN_MIRROR")
if args.debsec_mirror is None:
args.debsec_mirror = config.get_value("DEBSEC_MIRROR")
mirrors = [args.debsec_mirror, args.debian_mirror]
config = UDTConfig(opts.no_conf)
if opts.debian_mirror is None:
opts.debian_mirror = config.get_value('DEBIAN_MIRROR')
if opts.debsec_mirror is None:
opts.debsec_mirror = config.get_value('DEBSEC_MIRROR')
mirrors = [opts.debsec_mirror, opts.debian_mirror]
Logger.info("Downloading %s %s", args.package, args.version)
Logger.normal('Downloading %s %s', package, version)
newpkg = DebianSourcePackage(package, version, mirrors=mirrors)
newpkg = DebianSourcePackage(args.package, args.version, mirrors=mirrors)
try:
newpkg.pull()
except DownloadError, e:
Logger.error('Failed to download: %s', str(e))
except DownloadError as e:
Logger.error("Failed to download: %s", str(e))
sys.exit(1)
newpkg.unpack()
if opts.fetch_only:
if args.fetch_only:
sys.exit(0)
oldversion = previous_version(package, version, distance)
oldversion = previous_version(args.package, args.version, args.distance)
if not oldversion:
Logger.error('No previous version could be found')
Logger.error("No previous version could be found")
sys.exit(1)
Logger.normal('Downloading %s %s', package, oldversion)
Logger.info("Downloading %s %s", args.package, oldversion)
oldpkg = DebianSourcePackage(package, oldversion, mirrors=mirrors)
oldpkg = DebianSourcePackage(args.package, oldversion, mirrors=mirrors)
try:
oldpkg.pull()
except DownloadError, e:
Logger.error('Failed to download: %s', str(e))
except DownloadError as e:
Logger.error("Failed to download: %s", str(e))
sys.exit(1)
oldpkg.unpack()
print 'file://' + oldpkg.debdiff(newpkg, diffstat=True)
Logger.info("file://%s", oldpkg.debdiff(newpkg, diffstat=True))
if __name__ == '__main__':
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
Logger.normal('User abort.')
Logger.info("User abort.")

14
pull-debian-debs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-debian-debs -- pull deb package files for debian
# Basic usage: pull-debian-debs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="debian", pull="debs")

View File

@ -1,111 +1,14 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# pull-debian-source -- pull a source package from Launchpad
# Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
# Inspired by a tool of the same name by Nathan Handler.
# pull-debian-source -- pull source package files for debian
# Basic usage: pull-debian-source <package name> [version|release]
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# See pull-pkg
import optparse
import sys
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from devscripts.logger import Logger
from distro_info import DebianDistroInfo
from ubuntutools.pullpkg import PullPkg
from ubuntutools.archive import DebianSourcePackage, DownloadError, rmadison
from ubuntutools.config import UDTConfig
def is_suite(version):
"""If version could be considered to be a Debian suite, return the
canonical suite name. Otherwise None
"""
debian_info = DebianDistroInfo()
debian_releases = debian_info.all + ['experimental']
if '-' in version:
release, pocket = version.split('-', 1)
release = debian_info.codename(release, default=release)
if release in debian_releases:
if pocket in ('proposed-updates', 'p-u'):
return (release + '-proposed-updates')
elif pocket == 'security':
return (release + '-security')
else:
release = debian_info.codename(version, default=version)
if release in debian_releases:
return release
return None
def main():
usage = 'Usage: %prog <package> [release|version]'
parser = optparse.OptionParser(usage)
parser.add_option('-d', '--download-only',
dest='download_only', default=False, action='store_true',
help='Do not extract the source package')
parser.add_option('-m', '--mirror', metavar='DEBIAN_MIRROR',
dest='debian_mirror',
help='Preferred Debian mirror (default: %s)'
% UDTConfig.defaults['DEBIAN_MIRROR'])
parser.add_option('-s', '--security-mirror', metavar='DEBSEC_MIRROR',
dest='debsec_mirror',
help='Preferred Debian Security mirror (default: %s)'
% UDTConfig.defaults['DEBSEC_MIRROR'])
parser.add_option('--no-conf',
dest='no_conf', default=False, action='store_true',
help="Don't read config files or environment variables")
(options, args) = parser.parse_args()
if not args:
parser.error('Must specify package name')
elif len(args) > 2:
parser.error('Too many arguments. '
'Must only specify package and (optionally) release.')
config = UDTConfig(options.no_conf)
if options.debian_mirror is None:
options.debian_mirror = config.get_value('DEBIAN_MIRROR')
if options.debsec_mirror is None:
options.debsec_mirror = config.get_value('DEBSEC_MIRROR')
package = args[0].lower()
version = args[1] if len(args) > 1 else 'unstable'
component = None
suite = is_suite(version)
if suite is not None:
line = list(rmadison('debian', package, suite, 'source'))
if not line:
Logger.error('Unable to find %s in Debian suite "%s".', package,
suite)
sys.exit(1)
line = line[-1]
version = line['version']
component = line['component']
Logger.normal('Downloading %s version %s', package, version)
srcpkg = DebianSourcePackage(package, version, component=component,
mirrors=[options.debian_mirror,
options.debsec_mirror])
try:
srcpkg.pull()
except DownloadError, e:
Logger.error('Failed to download: %s', str(e))
sys.exit(1)
if not options.download_only:
srcpkg.unpack()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
Logger.normal('User abort.')
if __name__ == "__main__":
PullPkg.main(distro="debian", pull="source")

14
pull-debian-udebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-debian-udebs -- pull udeb package files for debian
# Basic usage: pull-debian-udebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="debian", pull="udebs")

14
pull-lp-ddebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-lp-ddebs -- pull ddeb package files for ubuntu
# Basic usage: pull-lp-ddebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ubuntu", pull="ddebs")

14
pull-lp-debs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-lp-debs -- pull deb package files for ubuntu
# Basic usage: pull-lp-debs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ubuntu", pull="debs")

View File

@ -1,108 +1,14 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# pull-lp-source -- pull a source package from Launchpad
# Basic usage: pull-lp-source <source package> [<release>]
# pull-lp-source -- pull source package files for ubuntu
# Basic usage: pull-lp-source <package name> [version|release]
#
# Copyright (C) 2008, Iain Lane <iain@orangesquash.org.uk>,
# 2010-2011, Stefano Rivera <stefanor@ubuntu.com>
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL for more details.
#
# ##################################################################
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
import os
import sys
from optparse import OptionParser
from ubuntutools.pullpkg import PullPkg
from devscripts.logger import Logger
from distro_info import UbuntuDistroInfo
from ubuntutools.archive import UbuntuSourcePackage, DownloadError
from ubuntutools.config import UDTConfig
from ubuntutools.lp.lpapicache import Distribution, Launchpad
from ubuntutools.lp.udtexceptions import (SeriesNotFoundException,
PackageNotFoundException,
PocketDoesNotExistError)
from ubuntutools.misc import split_release_pocket
def main():
usage = "Usage: %prog <package> [release|version]"
opt_parser = OptionParser(usage)
opt_parser.add_option('-d', '--download-only',
dest='download_only', default=False,
action='store_true',
help="Do not extract the source package")
opt_parser.add_option('-m', '--mirror', metavar='UBUNTU_MIRROR',
dest='ubuntu_mirror',
help='Preferred Ubuntu mirror (default: Launchpad)')
opt_parser.add_option('--no-conf',
dest='no_conf', default=False, action='store_true',
help="Don't read config files or environment "
"variables")
(options, args) = opt_parser.parse_args()
if not args:
opt_parser.error("Must specify package name")
config = UDTConfig(options.no_conf)
if options.ubuntu_mirror is None:
options.ubuntu_mirror = config.get_value('UBUNTU_MIRROR')
# Login anonymously to LP
Launchpad.login_anonymously()
package = str(args[0]).lower()
ubuntu_info = UbuntuDistroInfo()
if len(args) > 1: # Custom distribution specified.
version = str(args[1])
else:
version = os.getenv('DIST') or ubuntu_info.devel()
component = None
# Release, not package version number:
release = None
pocket = None
try:
(release, pocket) = split_release_pocket(version)
except PocketDoesNotExistError, e:
pass
if release in ubuntu_info.all and pocket is not None:
try:
spph = Distribution('ubuntu').getArchive().getSourcePackage(package,
release,
pocket)
except (SeriesNotFoundException, PackageNotFoundException), e:
Logger.error(str(e))
sys.exit(1)
version = spph.getVersion()
component = spph.getComponent()
Logger.normal('Downloading %s version %s', package, version)
srcpkg = UbuntuSourcePackage(package, version, component=component,
mirrors=[options.ubuntu_mirror])
try:
srcpkg.pull()
except DownloadError, e:
Logger.error('Failed to download: %s', str(e))
sys.exit(1)
if not options.download_only:
srcpkg.unpack()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
Logger.normal('User abort.')
if __name__ == "__main__":
PullPkg.main(distro="ubuntu", pull="source")

14
pull-lp-udebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-lp-udebs -- pull udeb package files for ubuntu
# Basic usage: pull-lp-udebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ubuntu", pull="udebs")

32
pull-pkg Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/python3
#
# pull-pkg -- pull package files for debian/ubuntu/uca/ppa
# Basic usage: pull-pkg -D distro -p type <package name> [version|release]
#
# Copyright (C) 2008, Iain Lane <iain@orangesquash.org.uk>,
# 2010-2011, Stefano Rivera <stefanor@ubuntu.com>
# 2017-2018, Dan Streetman <ddstreet@canonical.com>
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL for more details.
#
# ##################################################################
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main()

15
pull-ppa-ddebs Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
#
# pull-ppa-ddebs -- pull ddeb package files for a Launchpad Personal Package Archive
# Basic usage: pull-ppa-ddebs <package name> <ppa:USER/NAME> [version|release]
# pull-ppa-ddebs --ppa USER/NAME <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ppa", pull="ddebs")

15
pull-ppa-debs Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
#
# pull-ppa-debs -- pull deb package files for a Launchpad Personal Package Archive
# Basic usage: pull-ppa-debs <package name> <ppa:USER/NAME> [version|release]
# pull-ppa-debs --ppa USER/NAME <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ppa", pull="debs")

15
pull-ppa-source Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
#
# pull-ppa-source -- pull source package files for a Launchpad Personal Package Archive
# Basic usage: pull-ppa-source <package name> <ppa:USER/NAME> [version|release]
# pull-ppa-source --ppa USER/NAME <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ppa", pull="source")

15
pull-ppa-udebs Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/python3
#
# pull-ppa-udebs -- pull udeb package files for a Launchpad Personal Package Archive
# Basic usage: pull-ppa-udebs <package name> <ppa:USER/NAME> [version|release]
# pull-ppa-udebs --ppa USER/NAME <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="ppa", pull="udebs")

View File

@ -1,59 +0,0 @@
#!/usr/bin/perl
# Script Name: pull-revu-source
# Author: Nathan Handler <nhandler@ubuntu.com>
# Usage: pull-revu-source <source package>
# Copyright (C) 2009 Nathan Handler <nhandler@ubuntu.com>
# Based on revupull in kubuntu-dev-tools,
# written by Harald Sitter <apachelogger@ubuntu.com>
# License: GNU General Public License
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# On Debian GNU/Linux systems, the complete text of the GNU General
# Public License can be found in the /usr/share/common-licenses/GPL-3 file.
use warnings;
use strict;
use File::Basename;
use Getopt::Long;
my $REVU = "revu.ubuntuwire.com";
my($package) = lc($ARGV[0]) || usage(2);
my($help)=0;
GetOptions('help' => \$help);
usage(0) if($help);
eval { require LWP::Simple; };
if ($@=~ m#^Can\'t locate LWP/Simple#) {
print(STDERR "Please install libwww-perl.\n");
exit(1);
}
use LWP::Simple;
dget(getURL());
sub getURL {
my($url) = "http://" . $REVU . "/dsc.py?url&package=" . $package;
my($page)=get($url);
die("Could Not Get $url") unless (defined $page);
return $page;
}
sub dget {
my($dsc) = @_;
exec("dget -xu $dsc");
}
sub usage {
my($exit) = @_;
my($name)=basename($0);
print("USAGE: $name [-h] <source package>\n");
exit($exit);
}

14
pull-uca-ddebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-uca-ddebs -- pull ddeb package files for ubuntu cloud archive
# Basic usage: pull-uca-ddebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="uca", pull="ddebs")

14
pull-uca-debs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-uca-debs -- pull deb package files for ubuntu cloud archive
# Basic usage: pull-uca-debs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="uca", pull="debs")

14
pull-uca-source Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-uca-source -- pull source package files for ubuntu cloud archive
# Basic usage: pull-uca-source <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="uca", pull="source")

14
pull-uca-udebs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
#
# pull-uca-udebs -- pull udeb package files for ubuntu cloud archive
# Basic usage: pull-uca-udebs <package name> [version|release]
#
# See pull-pkg
# pylint: disable=invalid-name
# pylint: enable=invalid-name
from ubuntutools.pullpkg import PullPkg
if __name__ == "__main__":
PullPkg.main(distro="uca", pull="udebs")

6
pyproject.toml Normal file
View File

@ -0,0 +1,6 @@
[tool.black]
line-length = 99
[tool.isort]
line_length = 99
profile = "black"

326
requestbackport Executable file
View File

@ -0,0 +1,326 @@
#!/usr/bin/python3
#
# Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import argparse
import sys
from collections import defaultdict
import apt
from distro_info import UbuntuDistroInfo
from ubuntutools import getLogger
from ubuntutools.config import UDTConfig
from ubuntutools.lp.lpapicache import Distribution, Launchpad
from ubuntutools.lp.udtexceptions import PackageNotFoundException
from ubuntutools.question import EditBugReport, YesNoQuestion, confirmation_prompt
from ubuntutools.rdepends import RDependsException, query_rdepends
Logger = getLogger()
class DestinationException(Exception):
pass
def determine_destinations(source, destination):
ubuntu_info = UbuntuDistroInfo()
if destination is None:
destination = ubuntu_info.lts()
if source not in ubuntu_info.all:
raise DestinationException(f"Source release {source} does not exist")
if destination not in ubuntu_info.all:
raise DestinationException(f"Destination release {destination} does not exist")
if destination not in ubuntu_info.supported():
raise DestinationException(f"Destination release {destination} is not supported")
found = False
destinations = []
support_gap = False
for release in ubuntu_info.all:
if release == destination:
found = True
if release == source:
break
if found:
if support_gap:
if ubuntu_info.is_lts(release):
support_gap = False
else:
continue
if release not in ubuntu_info.supported():
support_gap = True
continue
destinations.append(release)
assert found
assert len(destinations) > 0
return destinations
def disclaimer():
print(
"Ubuntu's backports are not for fixing bugs in stable releases, "
"but for bringing new features to older, stable releases.\n"
"See https://wiki.ubuntu.com/UbuntuBackports for the Ubuntu "
"Backports policy and processes.\n"
"See https://wiki.ubuntu.com/StableReleaseUpdates for the process "
"for fixing bugs in stable releases."
)
confirmation_prompt()
def check_existing(package):
"""Search for possible existing bug reports"""
distro = Distribution("ubuntu")
srcpkg = distro.getSourcePackage(name=package.getPackageName())
bugs = srcpkg.searchTasks(
omit_duplicates=True,
search_text="[BPO]",
status=["Incomplete", "New", "Confirmed", "Triaged", "In Progress", "Fix Committed"],
)
if not bugs:
return
Logger.info(
"There are existing bug reports that look similar to your "
"request. Please check before continuing:"
)
for bug in sorted([bug_task.bug for bug_task in bugs], key=lambda bug: bug.id):
Logger.info(" * LP: #%-7i: %s %s", bug.id, bug.title, bug.web_link)
confirmation_prompt()
def find_rdepends(releases, published_binaries):
intermediate = defaultdict(lambda: defaultdict(list))
# We want to display every pubilshed binary, even if it has no rdepends
for binpkg in published_binaries:
intermediate[binpkg] # pylint: disable=pointless-statement
for arch in ("any", "source"):
for release in releases:
for binpkg in published_binaries:
try:
raw_rdeps = query_rdepends(binpkg, release, arch)
except RDependsException:
# Not published? TODO: Check
continue
for relationship, rdeps in raw_rdeps.items():
for rdep in rdeps:
# Ignore circular deps:
if rdep["Package"] in published_binaries:
continue
# arch==any queries return Reverse-Build-Deps:
if arch == "any" and rdep.get("Architectures", []) == ["source"]:
continue
intermediate[binpkg][rdep["Package"]].append((release, relationship))
output = []
for binpkg, rdeps in intermediate.items():
output += ["", binpkg, "-" * len(binpkg)]
for pkg, appearences in rdeps.items():
output += [f"* {pkg}"]
for release, relationship in appearences:
output += [f" [ ] {release} ({relationship})"]
found_any = sum(len(rdeps) for rdeps in intermediate.values())
if found_any:
output = [
"Reverse dependencies:",
"=====================",
"The following reverse-dependencies need to be tested against the "
"new version of %(package)s. "
"For reverse-build-dependencies (-Indep), please test that the "
"package still builds against the new %(package)s. "
"For reverse-dependencies, please test that the version of the "
"package currently in the release still works with the new "
"%(package)s installed. "
"Reverse- Recommends, Suggests, and Enhances don't need to be "
"tested, and are listed for completeness-sake.",
] + output
else:
output = ["No reverse dependencies"]
return output
def locate_package(package, distribution):
archive = Distribution("ubuntu").getArchive()
try:
package_spph = archive.getSourcePackage(package, distribution)
return package_spph
except PackageNotFoundException as e:
try:
apt_pkg = apt.Cache()[package]
except KeyError:
Logger.error(str(e))
sys.exit(1)
package = apt_pkg.candidate.source_name
Logger.info(
"Binary package specified, considering its source package instead: %s", package
)
return None
def request_backport(package_spph, source, destinations):
published_binaries = set()
for bpph in package_spph.getBinaries():
published_binaries.add(bpph.getPackageName())
if not published_binaries:
Logger.error(
"%s (%s) has no published binaries in %s. ",
package_spph.getPackageName(),
package_spph.getVersion(),
source,
)
Logger.info(
"Is it stuck in bin-NEW? It can't be backported until "
"the binaries have been accepted."
)
sys.exit(1)
testing = ["[Testing]", ""]
for dest in destinations:
testing += [f" * {dest.capitalize()}:"]
testing += [" [ ] Package builds without modification"]
testing += [f" [ ] {binary} installs cleanly and runs" for binary in published_binaries]
subst = {
"package": package_spph.getPackageName(),
"version": package_spph.getVersion(),
"component": package_spph.getComponent(),
"source": package_spph.getSeriesAndPocket(),
"destinations": ", ".join(destinations),
}
subject = "[BPO] %(package)s %(version)s to %(destinations)s" % subst
body = (
"\n".join(
[
"[Impact]",
"",
" * Justification for backporting the new version to the stable release.",
"",
"[Scope]",
"",
" * List the Ubuntu release you will backport from,"
" and the specific package version.",
"",
" * List the Ubuntu release(s) you will backport to.",
"",
"[Other Info]",
"",
" * Anything else you think is useful to include",
"",
]
+ testing
+ [""]
+ find_rdepends(destinations, published_binaries)
+ [""]
)
% subst
)
editor = EditBugReport(subject, body)
editor.edit()
subject, body = editor.get_report()
Logger.info("The final report is:\nSummary: %s\nDescription:\n%s\n", subject, body)
if YesNoQuestion().ask("Request this backport", "yes") == "no":
sys.exit(1)
distro = Distribution("ubuntu")
pkgname = package_spph.getPackageName()
bug = Launchpad.bugs.createBug(
title=subject, description=body, target=distro.getSourcePackage(name=pkgname)
)
bug.subscribe(person=Launchpad.people["ubuntu-backporters"])
for dest in destinations:
series = distro.getSeries(dest)
try:
bug.addTask(target=series.getSourcePackage(name=pkgname))
except Exception: # pylint: disable=broad-except
break
Logger.info("Backport request filed as %s", bug.web_link)
def main():
parser = argparse.ArgumentParser(usage="%(prog)s [options] package")
parser.add_argument(
"-d",
"--destination",
metavar="DEST",
help="Backport to DEST release and necessary "
"intermediate releases "
"(default: current LTS release)",
)
parser.add_argument(
"-s",
"--source",
metavar="SOURCE",
help="Backport from SOURCE release (default: current devel release)",
)
parser.add_argument(
"-l",
"--lpinstance",
metavar="INSTANCE",
default=None,
help="Launchpad instance to connect to (default: production).",
)
parser.add_argument(
"--no-conf",
action="store_true",
dest="no_conf",
default=False,
help="Don't read config files or environment variables",
)
parser.add_argument("package", help=argparse.SUPPRESS)
args = parser.parse_args()
config = UDTConfig(args.no_conf)
if args.lpinstance is None:
args.lpinstance = config.get_value("LPINSTANCE")
Launchpad.login(args.lpinstance)
if args.source is None:
args.source = Distribution("ubuntu").getDevelopmentSeries().name
try:
destinations = determine_destinations(args.source, args.destination)
except DestinationException as e:
Logger.error(str(e))
sys.exit(1)
disclaimer()
package_spph = locate_package(args.package, args.source)
check_existing(package_spph)
request_backport(package_spph, args.source, destinations)
if __name__ == "__main__":
main()

Some files were not shown because too many files have changed in this diff Show More