131 Commits

Author SHA1 Message Date
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
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
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
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
b1bc7e1cdc Address pylint complaints
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 23:10:31 +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
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
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
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
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
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
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
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
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
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
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
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Stefano Rivera
301569e809 Pull out Python 2 support hacks 2019-09-04 19:24:44 -03:00
Stefano Rivera
7f9949fc4c Port backportpackage to Python 3. 2019-09-04 19:24:44 -03:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +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
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
Adam Gandelman
a26129d283 backportpackage: Fix destination for --dont-sign option. (LP: #1183985) 2013-05-24 12:58:12 -07:00
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01: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
1804158370 Correct metavar for --mirror in backportpackage (LP: #999727) 2012-06-20 22:13:49 +02:00
Stefano Rivera
d45bb86bcd Work when there's no DEBEMAIL too 2012-06-17 19:54:40 +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
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
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
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
ebe44bf04e backportpackage: Allow unsigned backports (LP: #992739) 2012-05-06 13:09:54 +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
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
767951addb backportpackage: Map Debian release aliases to codenames (LP: #918231) 2012-02-15 16:57:17 +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
9e1a6f6ff9 backportpackage: Drop unused imports. 2011-12-21 22:13:25 +01: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
Stefano Rivera
fb44f55379 Remove redundant optparse parameters from backportpackage 2011-12-21 22:31:33 +02:00