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.
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.
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>
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>
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>
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>
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>
-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>
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>