2946 Commits

Author SHA1 Message Date
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 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