46 Commits

Author SHA1 Message Date
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
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
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
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05: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
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
6a60ee963d Port pull-debian-debdiff to Python 3 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
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +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
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
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01:00
Benjamin Drung
e8b3a18c45 Move suspicious-source and wrap-and-sort from ubuntu-dev-tools into devscripts. 2011-05-23 23:41:00 +02:00
Stefano Rivera
e3ea0c9b97 pull-debian-debdiff: Convert distance to an integer, so it works when
specified.
2011-03-28 13:10:29 +02:00
Stefano Rivera
1ce4774db7 Make that 'User abort.' 2011-03-06 01:12:24 +02:00
Stefano Rivera
6e485c2a7b pull-{lp,debian}-source, pull-debian-debdiff: Catch KeyboardInterrupt.
(LP: #713845)
2011-03-06 01:04:22 +02:00
Stefano Rivera
8657394219 Catch DownloadErrors in ubuntutools.archive users. (LP: #708862) 2011-01-31 19:01:10 +02:00
Stefano Rivera
19221fd2bc Drop unused imports 2011-01-20 01:09:07 +02:00
Stefano Rivera
ed91b960e2 Move debdiff into SourcePackage 2011-01-15 13:28:44 +02:00
Stefano Rivera
3ef8324ff7 Improve error handling 2011-01-01 19:51:03 +02:00
Stefano Rivera
a2da2da87b Snapshot and rmadison support 2010-12-30 19:50:07 +02:00
Stefano Rivera
5553c11ddd Beginnings of an OO ubuntutools.archive.SourcePackage 2010-12-29 23:13:48 +02:00
Stefano Rivera
be79f00dff Lets make ubuntutools.mirrors return filenames 2010-12-28 00:42:35 +02:00
Stefano Rivera
2c27cf68a6 Move common downloading code into new ubuntutools.mirrors. Use in backportpackage, pull-debian-debdiff, pull-lp-source 2010-12-28 00:23:53 +02:00
Benjamin Drung
4215c94b92 pull-debian-debdiff: Make pylint happier. 2010-12-27 20:14:47 +01:00
Stefano Rivera
00faea17e2 Remove devscripts checks (we Depend on it). Reword python-simplejson error 2010-12-25 18:31:00 +02:00
Stefano Rivera
b5274624ac Suggest python-simplejson | python (>= 2.7) and complain if they are missing in pull-debian-debdiff 2010-12-25 18:06:18 +02:00
Stefano Rivera
5182d62de1 if...else precedence in dget calls 2010-12-24 13:47:22 +02:00
Stefano Rivera
0d51908f40 Add mirror support to pull-lp-source 2010-12-24 12:00:03 +02:00
Stefano Rivera
088341fa7c snapshot: Don't re-download existing files if hashes match 2010-12-24 11:17:25 +02:00
Stefano Rivera
3354374972 Actually --no-fallback makes no sense for these scripts, although we probably want it for test-builders 2010-12-24 11:08:55 +02:00
Stefano Rivera
8e27317b65 Rename mirror variables, add Ubuntu 2010-12-24 03:04:42 +02:00
Stefano Rivera
cf68c75fa8 - Support this in many u-d-t scripts, and update manpages.
- Deprecate old configuration environment variables.
* pull-debian-debdiff: Rewrite in Python, and use snapshot.debian.org.
2010-12-24 02:58:54 +02:00
Stefano Rivera
30b6628910 Config file support for pull-debian-debdiff 2010-12-24 01:07:48 +02:00
Stefano Rivera
c4de897e2a 404main, merge-changelog, pull-debian-debdiff, pull-debian-source:
Return 0 after showing help.
2010-12-22 16:53:58 +02:00
Benjamin Drung
1943df29eb Remove all trailing spaces. 2010-12-03 00:06:43 +01:00
Siegfried-Angel Gevatter Pujals
0faf0bc3e5 Relicense Kees' scripts to GPLv3+. Add sbuild as alternative recommend to pbuilder. 2008-08-12 20:15:15 +02:00
Siegfried-Angel Gevatter Pujals
d3efcc879f Remove unneeded AUTHORS and README. Add the GPL header to all scripts. 2008-08-11 20:06:35 +02:00
Kees Cook
b1669fec32 * pull-debian-debdiff:
- parse .dsc file for required source files.
  - switch to GPLv3
* debian/control: add Depends needed for pull-debian-debdiff.
* debian/copyright:
  - updated pull-debian-debdiff, which is now GPLv3.
  - adjusted Copyright lines to make lintian happy.
2008-06-13 11:46:23 -07:00
Siegfried-Angel Gevatter Pujals (RainCT)
49cbb653f3 Complete the README file. Unify all script headers. Delete pbuilder-template (same as -dist). Change my mail address. 2007-08-04 13:52:30 +02:00
Kees Cook
4c6b3cbe98 adding new tools I wrote and use 2007-06-14 12:29:32 -07:00