Julian Andres Klode [Wed, 1 Jun 2016 12:31:10 +0000 (14:31 +0200)]
Get rid of .bzrignore
Gbp-Dch: ignore
David Kalnischkies [Sun, 29 May 2016 20:09:51 +0000 (22:09 +0200)]
try to detect sudo spawned root-shell in prefixing
It is a try as the we need to inspect SUDO_COMMAND which could be
anything – apt, apt-get, in /usr/bin, in a $DPKG_ROOT "chroot", build
from source, aliases, …
The best we can do is look if the SHELL variable is equal to the
SUDO_COMMAND which would mean a shell was invoked. That isn't fail-safe
if different shells are involved as sub-shells have the tendency of not
overriding the SHELL so a bash started from within zsh can happily
pretend to be still zsh, so we could have a look at /etc/shells for a
list, but oh well, we have to stop somewhere I guess.
This sudo-prefixing feature is a gimmick after all.
Closes: 825742
David Kalnischkies [Sat, 28 May 2016 15:02:26 +0000 (17:02 +0200)]
travis: use gcc-5 instead of gcc(-4.9)
The std::put_time and std::get_time introduced in
9febc2b238e1e322dce1f94ecbed46d595893b52 are part of C++11, but not
implemented in GCC until version 5. std::put_time could actually be
worked around via using the facets put() directly, but get() isn't
implemented so that doesn't really help.
We require various tools from wily (which also means we can't build apt
on Debian stable) already, so requiring gcc-5 is just one more instead
of a big step [and an ignoreable change for changelog anyhow].
It also helps in testing what will actually be used (in terms of the
c++11 std ABI) instead of the old ABI.
Git-Dch: Ignore
David Kalnischkies [Sat, 28 May 2016 11:53:09 +0000 (13:53 +0200)]
look into the right textdomain for apt-utils again
Broken in
e7e10e47476606e3b2274cf66b1e8ea74b236757 by looking always
into "apt" while we ship some tools in "apt-utils"…
David Kalnischkies [Sat, 28 May 2016 11:22:38 +0000 (13:22 +0200)]
use std::locale::global instead of setlocale
We use a wild mixture of C and C++ ways of generating output, so having
a consistent world-view in both styles sounds like a good idea and
should help in preventing regressions.
David Kalnischkies [Sat, 28 May 2016 10:55:21 +0000 (12:55 +0200)]
use de-localed std::put_time instead rolling our own
David Kalnischkies [Sat, 28 May 2016 10:41:12 +0000 (12:41 +0200)]
avoid changing the global LC_TIME for Release writing
Using C++ here avoids calling setlocale here which never really was that
ideal, but needed to avoid locale specific weekday/month names.
David Kalnischkies [Sat, 28 May 2016 09:03:35 +0000 (11:03 +0200)]
accept only the expected UTC timezones in date parsing
HTTP/1.1 hardcodes GMT (RFC 7231 §7.1.1.1) and what is good enough for the
internet must be good enough for us™ as we reuse the implementation
internally to parse (most) dates we encounter in various places like the
Release files with their Date and Valid-Until header fields.
Implementing a fully timezone aware parser just feels too hard for no
effective benefit as it would take 5+ years (= until LTS's are out of
fashion) until a repository could use non-UTC dates and expect it to
work. Not counting non-apt implementations which might or might not
only want to encounter UTC here as well.
As a bonus, this eliminates the use of an instance of setlocale in
libapt.
Closes: 819697
David Kalnischkies [Fri, 27 May 2016 16:10:39 +0000 (18:10 +0200)]
prevent C++ locale number formatting in text APIs
Setting the C++ locale via std::locale::global(std::locale("")); which
would otherwise default to the default C locale (aka: unaffected by
setlocale) effects the formatting of numeric types in IO streams, which
for output for humans is perfectly sensible, but breaks our many text
interfaces used and parsed by us and others without expecting the
numbers to be formatted.
Closes: #825396
David Kalnischkies [Fri, 27 May 2016 10:08:32 +0000 (12:08 +0200)]
fix and document on the fly compressor config
libapt allows to configure compressors to be used by its system via
configuration implemented in
03bef78461c6f443187b60799402624326843396,
but that was never really documented and also only partly working, which
also explains why the tests weren't using it…
David Kalnischkies [Wed, 25 May 2016 06:32:01 +0000 (08:32 +0200)]
use *.docs files instead of hardcoding in debian/rules
Git-Dch: Ignore
David Kalnischkies [Wed, 25 May 2016 06:27:58 +0000 (08:27 +0200)]
remove semi-support for different build-dirs
The debian/rules file tries to guess in which directory it is supposed
to be building, but that guess is always ./build – if it wasn't it
would fail later as not all rules take alternatives into acount.
So, as this is clearly not used lets remove this complexity instead of
fixing it up.
Git-Dch: Ignore
David Kalnischkies [Tue, 24 May 2016 07:55:49 +0000 (09:55 +0200)]
override lintian on doxygens embedded-javascript-library
The embedding is done completely automatic by doxygen and documented to
be that way for reasons: /usr/share/doc/doxygen/README.jquery
As we can't do anything about it, it is pointless to keep the warning.
David Kalnischkies [Tue, 24 May 2016 08:43:10 +0000 (10:43 +0200)]
use https instead of git for Vcs-Git
Reported-By: lintian: vcs-field-uses-insecure-uri
Git-Dch: Ignore
David Kalnischkies [Tue, 24 May 2016 08:40:22 +0000 (10:40 +0200)]
fix two typos in untranslated errors of libapt-pkg
Reported-By: lintian: spelling-error-in-binary
Git-Dch: Ignore
David Kalnischkies [Tue, 24 May 2016 08:37:57 +0000 (10:37 +0200)]
fix two typos in apt.conf & apt-cache manpage
Reported-By: lintian: spelling-error-in-manpage
Git-Dch: Ignore
David Kalnischkies [Tue, 24 May 2016 07:24:28 +0000 (09:24 +0200)]
remove duplicated 'the' from guides doc-base abstract
Reported-By: lintian: spelling-error-in-doc-base-abstract-field
Git-Dch: Ignore
David Kalnischkies [Tue, 24 May 2016 07:37:01 +0000 (09:37 +0200)]
no-change bump of Standards-Version to 3.9.8
We don't have no menu file.
David Kalnischkies [Fri, 20 May 2016 13:40:09 +0000 (15:40 +0200)]
update symbols file
David Kalnischkies [Fri, 20 May 2016 12:42:50 +0000 (14:42 +0200)]
don't try to get acquire lock in simulation mode
The code moving in
eb1f04dda07c2b69549ad9fd793cca0e91841b3e
moved the acquire stuff above the simulation exit, so before getting
locks (and creating/chmod directories) we should be checking if we
should actually really do it…
[ignore as bugfix of an unreleased commit]
Git-Dch: Ignore
David Kalnischkies [Sat, 14 May 2016 16:07:12 +0000 (18:07 +0200)]
refactor EDSP code into EDSP and EDSP-like parts
No real code change, just moving code around heavily to decouple the
EDSP specific parts from those we can reuse for EDSP-like protocols.
Git-Dch: Ignore
David Kalnischkies [Fri, 6 May 2016 14:46:51 +0000 (16:46 +0200)]
edsp: use a limited scenario based on bool-array
Its more space and runtime efficient to use a boolean set instead of a
CacheSet-based implementation.
Git-Dch: Ignore
David Kalnischkies [Fri, 6 May 2016 12:21:02 +0000 (14:21 +0200)]
edsp: add Forbid-{New-Install,Remove} and Upgrade-All
This allows to differentiate properly between 'apt-get upgrade', 'apt
upgrade' and 'apt full-upgrade'.
David Kalnischkies [Mon, 2 May 2016 16:25:58 +0000 (18:25 +0200)]
avoid triggering gcc's -Wunsafe-loop-optimizations in EDSP
apt/apt-pkg/edsp.cc: In function ‘bool EDSP::WriteLimitedScenario(pkgDepCache&, FILE*, const PackageSet&, OpProgress*)’:
apt/apt-pkg/edsp.cc:245:56: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
std::string dependencies[pkgCache::Dep::Enhances + 1];
^
Using a std::array to silence gcc as well as as a code improvement feels right here.
Git-Dch: Ignore
David Kalnischkies [Wed, 27 Apr 2016 15:36:07 +0000 (17:36 +0200)]
edsp: dump: support dumping into compressed file
David Kalnischkies [Wed, 27 Apr 2016 11:44:08 +0000 (13:44 +0200)]
edsp: try harder to not generate unneeded error messages
The &= introduced in the EDSP-FileFd conversion isn't working to full
satisfaction for multiple && clauses as the && has a higher binding than
&= has, so that the methods were called even through they shouldn't
have because of previous errors. Using variadic functions we can solve
this in a slightly cleaner way bringing down the amount of 'broken pipe'
errors for the error case of the dump resolver substantially.
Git-Dch: Ignore
David Kalnischkies [Tue, 26 Apr 2016 10:26:12 +0000 (12:26 +0200)]
convert EDSP to be based on FileFd instead of FILE*
I doubt there is any non-src:apt usage of these interfaces.
David Kalnischkies [Fri, 20 May 2016 07:37:24 +0000 (09:37 +0200)]
fail instead of segfault on unreadable config files
The report mentions "apt list --upgradable", but there are others which
have inconsistent behavior ranging from segfaulting to doing something
with the partial (and hence incomplete) data. We had a recent report
about sources.list (#818628), this one mentions prefences, the obvious
next step is conf files… so the testcase is adapted to check for all
three in file and directory versions and run a bunch of commands each
time which should all have more or less the same behavior in such a case
(aka error out).
Closes: 824503
Yuri Kozlov [Thu, 19 May 2016 18:54:32 +0000 (20:54 +0200)]
Russian program translation update
Closes: 824702
David Kalnischkies [Mon, 16 May 2016 15:18:49 +0000 (17:18 +0200)]
document --no- as --show-upgraded is the default
--show-upgraded is the default since
906fbf8886926eeb302332d997c9bd861291e155 so documenting it as if it
would be an option having an effect as is feels wrong and we do the same
for other options like install-recomends, download, …, too.
This commit also removes -u from the documentation, but still supports
it in the commandline parsing. Eventually we should deprecate the short
option, but for now lets just stop documenting it.
Closes: 824456
David Kalnischkies [Sat, 14 May 2016 08:43:03 +0000 (10:43 +0200)]
show final solution in --no-download --fix-missing mode
This commit moves the creation of the fetcher and with it the
calculation of the filenames before the code generation the various
lists detailing the solution. This means that simulation comes even so
slightly closer to a real run as it will require and parse the package
indexes for filenames and queuing of URIs, so that a simulation "using"
an unavailable download method actually fails now.
The real benefit of this change is through that the rather special but
nontheless handy --no-download --fix-missing mode now actually shows
what the solution is it will apply to the system rather than the
solution it would if it could download all not-downloaded packages.
David Kalnischkies [Fri, 13 May 2016 14:59:09 +0000 (16:59 +0200)]
show globalerrors before asking for confirmation
Errors cause a kind of automatic no already, but warnings and notices
are only displayed at the end of the apt execution even through they
could effect the choice of saying yes/no to questions: E.g. if a
configuration (file) was ignored you wanted to have an effect or if an
external solver you used generated warnings suggesting that the solution
might be valid, but bogus non-the-less and similar things.
Note that this only moves those messages up to the question if the
answer is interactive – not if e.g. -y is used or no question is asked at
all so this has an effect only on interactive usage of apt(-get), not
script who might be parsing apt output.
Julian Andres Klode [Thu, 12 May 2016 08:04:19 +0000 (10:04 +0200)]
Normalize Signed-By values by removing trailing commas everywhere
This fixes comparisons where either the stored or the input string
have a trailing comma.
Julian Andres Klode [Sun, 15 May 2016 17:16:54 +0000 (19:16 +0200)]
Add conflicting Signed-By values to error message
This hopefully makes debugging things easier.
Julian Andres Klode [Sun, 15 May 2016 16:11:48 +0000 (18:11 +0200)]
apt.systemd.daily: Put opening brace of check_power on extra line
The rest is also on the same line, so let's go consistent here
now that we have a bug report about it.
LP: #
1581985
Zhou Mo [Sat, 14 May 2016 12:18:13 +0000 (12:18 +0000)]
zh_CN.po: update simplified Chinese translation.
Julian Andres Klode [Fri, 13 May 2016 08:06:31 +0000 (10:06 +0200)]
Provide complete apt bash completion
This fixes Debian/apt#13 and the launchpad bug listed below,
but is far more advanced. I went through private-cmndline.cc
and looked at the supported options.
LP: #
1573547
Thanks: Elias Fröhner and Svyatoslav Gryaznov for the initial work
David Kalnischkies [Thu, 12 May 2016 14:21:10 +0000 (16:21 +0200)]
edsp: warn if unexpected stanzas appear in the solution
Unexpected are for examples removal requests for versions which aren't
installed, installations of already installed versions & requests to
install and remove a package at the same time.
Johannes 'josch' Schauer [Thu, 12 May 2016 11:07:59 +0000 (13:07 +0200)]
edsp: document unique package identifiers
Document that package identifiers must be unique (apt only uses the last
action for a given identifier) and that install requests do also imply
upgrades and downgrades (and thus removal of the old version). This is
to prevent that solvers express an upgrade or downgrade instruction as
two stanzas: a removal of the old version and an installation of the new
version. Instead, a single install stanza is sufficient to express
upgrade or downgrade requests.
Julian Andres Klode [Wed, 11 May 2016 08:51:06 +0000 (10:51 +0200)]
Release 1.3~exp1
Frans Spiesschaert [Tue, 10 May 2016 21:21:46 +0000 (23:21 +0200)]
Dutch program translation update
Closes: 823976
David Kalnischkies [Tue, 10 May 2016 20:48:31 +0000 (22:48 +0200)]
edsp: support generic and solver-specific configs
The spec was slightly inconsistent if the preferences setting is
available only as generic or specific setting & the code only supported
the specific one, while for the strict-pinning was only generic…
As the usual pattern for apt is to have both options we adapt the spec
and code to support both as well.
This also adds a purely informal "Solver" field so in case the request
is saved in a file, we know to which solver the sent preferences apply.
Closes: 823918
Julian Andres Klode [Tue, 10 May 2016 17:15:17 +0000 (19:15 +0200)]
update: Run Post-Invoke-Success if not all sources failed
Failures can happen and APT regardless will do a partial cache
update anyway. Because APT ensures that the list directory is
in a sane state, it makes sense to also call success hooks if
success was only partial - otherwise it loses sync with APT.
Most importantly, this causes the appstream cache to be empty,
see launchpad bug #
1562733.
This is somewhat overly optimistic though: As soon as any repository
has nonexisting optional files, the missing optional files are also
treated as success, which means a single broken repository without an
InRelease file still runs Success hooks, even though it really should
not.
Julian Andres Klode [Tue, 10 May 2016 17:09:19 +0000 (19:09 +0200)]
Strip trailing commas for created signed-by fingerprint lists
This prevented some sources.list entries from working, an example
of which can be found in the test.
Julian Andres Klode [Tue, 10 May 2016 16:32:06 +0000 (18:32 +0200)]
Merge pull request julian-klode/apt#3 from adrian17/master
Improve GetLocalitySortedVersionSet, speeds up apt search by 30%
David Kalnischkies [Tue, 10 May 2016 12:51:30 +0000 (14:51 +0200)]
don't sent uninstallable rc-only versions via EDSP
Versions which are only available in dpkg/status aren't installable and
apt doesn't pick them as candidate for this reason – for the same reason
such packages shouldn't be sent to an external solver via EDSP. The
packages are pinned to -1, but if the solver has strict pinning disabled
it could end up picking this version anyhow – which is a request apt can
not satisfy.
Reported-By: Maximiliano Curia <maxy@debian.org> on IRC
Adrian Wielgosik [Sun, 8 May 2016 19:59:45 +0000 (21:59 +0200)]
Speed up GetLocalitySortedVersionSet.
David Kalnischkies [Sun, 8 May 2016 17:46:34 +0000 (19:46 +0200)]
gpgv: show always webportal error on NODATA
gpg doesn't give use a UID on NODATA, which we were "expecting" (but not
using for anything), but just an error number. Instead of collecting
these as badsigners which will trigger a "invald signature" error with
remarks like "NODATA 1" we instead adapt a message similar to the NODATA
error of a clearsigned file (which is actually not reached anymore as we
split them up, which fails with a NOSPLIT error, which uses the same
general error message).
In other words: Not a security relevant change, just a user experience
improvement as we now point them to the most likely cause of the
problem instead of saying "invalid signature" which would point them in
the direction of the archive being broken (for everyone) instead.
Closes: 823746
David Kalnischkies [Sun, 8 May 2016 16:03:48 +0000 (18:03 +0200)]
implement Identifier field for IndexTargets
A frontend like apt-file is only interested in a specific set of files
and selects those easily via "Created-By". If it supports two locations
for those files through it would need to select both and a user would
need to know that implementation detail for sources.list configuration.
The "Identifier" field is hence introduced which by default has the same
value as "Created-By", but can be freely configured – especially it can
be used to give two indexes the same identifier.
David Kalnischkies [Sun, 8 May 2016 09:58:36 +0000 (11:58 +0200)]
implement Fallback-Of for IndexTargets
Sometimes index files are in different locations in a repository as it
is currently the case for Contents files which are per-component in
Debian, but aren't in Ubuntu. This has historic reasons and is perhaps
changed soon, but such cases of transitions can always happen in the
future again, so we should prepare:
Introduced is a new field declaring that the current item should only be
downloaded if the mentioned item wasn't allowing for transitions without
a flagday in clients and archives.
This isn't implemented 'simpler' with multiple MetaKeys as items (could)
change their descriptions and perhaps also other configuration bits with
their location.
David Kalnischkies [Sat, 7 May 2016 14:45:35 +0000 (16:45 +0200)]
download arch:all also for NATIVE_ARCHITECTURE indextargets
It looks a bit strange on the outside to have multiple "native
architecture", but all is considered an implementation detail and e.g.
packages of arch:all are in dependency resolution equal to native
packages.
David Kalnischkies [Sat, 7 May 2016 12:52:08 +0000 (14:52 +0200)]
don't construct MetaIndex acquire items with IndexTargets
We don't have to initialize the Release files with a set of IndexTargets
to acquire, but instead wait for the Release file to be acquired and
only then ask which IndexTargets to get.
Git-Dch: Ignore
David Kalnischkies [Sat, 7 May 2016 12:44:53 +0000 (14:44 +0200)]
delay progress until Release files are downloaded
Progress reporting used an "upper bound" on files we might get, expect
that this wasn't correct in case pdiff entered the picture. So instead
of calculating a value which is perhaps incorrect, we just accept that
we can't tell how many files we are going to download and just keep at
0% until we know. Additionally, if we have pdiffs we wait until we got
these (sub)index files, too.
That could all be done better by downloading all Release files first and
planing with them in hand accordingly, but one step at a time.
David Kalnischkies [Sat, 7 May 2016 12:08:35 +0000 (14:08 +0200)]
TransactionManager can never be a nullptr
The code naturally evolved from a TransactionManager optional to a
required setup which resulted in various places doing unneeded checks
suggesting a more complicated setup than is actually needed.
Git-Dch: Ignore
David Kalnischkies [Sat, 7 May 2016 11:45:25 +0000 (13:45 +0200)]
fix same-mirror redirection for Release{,.gpg} pair
Commit
9b8034a9fd40b4d05075fda719e61f6eb4c45678 just deals with
InRelease properly and generates broken URIs in case the mirror (or the
achieve really) has no InRelease file.
[As this was in no released version no need to clutter changelog with a
fix notice.]
Git-Dch: Ignore
David Kalnischkies [Wed, 4 May 2016 09:45:35 +0000 (11:45 +0200)]
tests: disable generation of Release.gpg by default
Most tests just need a signed repository and don't care if it signed by
an InRelease file or a Release.gpg file, so we can save some time by
just generating one of them by default.
Sounds like not much, but quickly adds up to a few seconds with the
amount of tests we have accumulated by now.
Git-Dch: Ignore
David Kalnischkies [Wed, 4 May 2016 09:10:08 +0000 (11:10 +0200)]
tests: allow to disable generation of InRelease/Release.gpg file
If the test just signs release files to throw away one of them to test
the other, we can just as well save the time and not create it.
Git-Dch: Ignore
David Kalnischkies [Wed, 4 May 2016 08:08:16 +0000 (10:08 +0200)]
test: fix permission issue if run as root
Always those silly mistakes. Do what I mean, not what I said…
Reported-By: Travis
Git-Dch: Ignore
David Kalnischkies [Tue, 3 May 2016 21:22:53 +0000 (23:22 +0200)]
allow redirection for items without a space in the desc again
Broken in
a4b8112b19763cbd2c12b81d55bc7d43a591d610.
If an item has a description which includes no space and is redirected
to another mirror the code which wants to rewrite the description
expects a space in there, but can't find it and the unguarded substr
command on the string will fail with an exception thrown…
Guarding it properly and everything is fine.
David Kalnischkies [Tue, 3 May 2016 12:11:30 +0000 (14:11 +0200)]
let DPKG_COLORS default to our APT::Color setting
dpkg can optionally colorize its output since 1.18.5. Currently this
defaults to 'never', but it will eventually be 'auto'. It seems
reasonable to assume that a user who has enabled/disabled colors in apt
will want to have dpkg have the same state regarding color usage.
This isn't overriding explicit settings by the user, so in case a user
feels strongly about it one way or the other there are options.
David Kalnischkies [Mon, 2 May 2016 16:18:37 +0000 (18:18 +0200)]
remove 100-levels config nesting limit
The actual reason for this commit isn't the limit – there isn't much
point in using that much nesting – its in shutting up gcc mostly:
apt/apt-pkg/contrib/configuration.cc: In function ‘bool ReadConfigFile(Configuration&, const string&, const bool&, const unsigned int&)’:
apt/apt-pkg/contrib/configuration.cc:686:20: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
string Stack[100];
^
by replacing this with C++s handy std::stack container (adapter).
Also cleans some whitespace noise from the file in the process.
Carsten Hey [Sun, 1 May 2016 15:06:29 +0000 (17:06 +0200)]
apt-key: add \n to dpkg-query --show --showformat
Guarding against 'broken' greps not dealing with non-text inputs
"just in case" by making the input text with a proper newline.
[commit message by David Kalnischkies]
Reported-On: IRC
Git-Dch: Ignore
David Kalnischkies [Sun, 1 May 2016 12:43:23 +0000 (14:43 +0200)]
warn if apt-key is run unconditionally in maintainerscript
We want to stop hard-depending on gnupg and for this it is essential
that apt-key isn't used in any critical execution path, which
maintainerscript are. Especially as it is likely that these script call
apt-key either only for (potentially now outdated cleanup) or still not
use the much simpler trusted.gpg.d infrastructure.
David Kalnischkies [Sun, 1 May 2016 10:50:53 +0000 (12:50 +0200)]
move gnupg|gnupg2 from apt Depends to Recommends
apt doesn't need gnupg in its main execution paths to function,
especially the Release file verification is done with gpgv only.
It is only used by apt-key for advanced key management functionality
most user will never use nor need.
The intend is to demote it eventually to Suggests, but we opt here for a
staged downgrade as there are still third-party repositories out there
which require apt-key functionality without depending on gnupg (or apt
for that matter).
Adrian Wielgosik [Fri, 29 Apr 2016 08:38:02 +0000 (10:38 +0200)]
Don't copy strings in Startswith, Endswith
Julian Andres Klode [Sun, 1 May 2016 09:38:44 +0000 (11:38 +0200)]
ftparchive: Support writing Signed-By fields
David Kalnischkies [Fri, 29 Apr 2016 16:40:08 +0000 (18:40 +0200)]
bugscript: include all configuration fragment files
Closes: 820861
David Kalnischkies [Fri, 29 Apr 2016 14:48:16 +0000 (16:48 +0200)]
support Signed-By in Release files as a sort of HPKP
Users have the option since apt >= 1.1 to enforce that a Release file is
signed with specific key(s) either via keyring filename or fingerprints.
This commit adds an entry with the same name and value (except that it
doesn't accept filenames for obvious reasons) to the Release file so
that the repository owner can set a default value for this setting
effecting the *next* Release file, not the current one, which provides a
functionality similar "HTTP Public Key Pinning". The pinning is in
effect as long as the (then old) Release file is considered valid, but
it is also ignored if the Release file has no Valid-Until at all.
David Kalnischkies [Fri, 29 Apr 2016 08:16:42 +0000 (10:16 +0200)]
support multiple fingerprints in signed-by
A keyring file can include multiple keys, so its only fair for
transitions and such to support multiple fingerprints as well.
David Kalnischkies [Fri, 29 Apr 2016 08:08:13 +0000 (10:08 +0200)]
gpgv: cleanup statusfd parsing a bit
We parse the messages we receive into two big categories: Most of the
messages have a keyid as well as a userid and as they are errors we want
to show the userids as well. The other category is also errors, but have
no userid (like NO_PUBKEY). Explicitly expressing this in code should
make it a bit easier to look at and it also help in dropping additional
fields or just the newline at the end consistently.
Git-Dch: Ignore
David Kalnischkies [Thu, 28 Apr 2016 22:31:49 +0000 (00:31 +0200)]
don't show NO_PUBKEY warning if repo is signed by another key
Daniel Kahn Gillmor highlights in the bugreport that security isn't
improving by having the user import additional keys – especially as
importing keys securely is hard.
The bugreport was initially about dropping the warning to a notice, but
in given the previously mentioned observation and the fact that we
weren't printing a warning (or a notice) for expired or revoked keys
providing a signature we drop it completely as the code to display a
message if this was the only key is in another path – and is considered
critical.
Closes: 618445
David Kalnischkies [Thu, 28 Apr 2016 20:02:50 +0000 (22:02 +0200)]
gpgv: handle expired sig as worthless
Signatures on data can have an expiration date, too, which we hadn't
handled previously explicitly (no problem – gpg still has a non-zero
exit code so apt notices the invalid signature) so the error message
wasn't as helpful as it could be (aka mentioning the key signing it).
David Kalnischkies [Thu, 28 Apr 2016 17:05:06 +0000 (19:05 +0200)]
gpgv: use EXPKEYSIG instead of KEYEXPIRED
The upstream documentation says about KEYEXPIRED:
"This status line is not very useful". Indeed, it doesn't mention which
key is expired, and suggests to use the other message which does.
David Kalnischkies [Thu, 28 Apr 2016 13:03:55 +0000 (15:03 +0200)]
show StateCache flags in Pkg debug prettyprint
This basically introduces ~33 flags in the output, but a package can
have only ~11 of them displayed at the same time. There is quiet a bit
of duplication also (an uninstalled package is by definition a
newinstall if its getting installed), but as this is debug output we are
better of showing them all in case one of them isn't set in a way it is
supposed to be set.
Git-Dch: Ignore
Zhou Mo [Sat, 30 Apr 2016 13:24:42 +0000 (13:24 +0000)]
zh_TW.po: remove several fuzzy tags after review
James McCoy [Wed, 20 Apr 2016 02:27:21 +0000 (22:27 -0400)]
deb822: Restore support for <multivalue>-{Add,Remove}
Redesign of multivalue options in
463c8d801595ce5ac94d7c032264820be7434232
caused the parser to look for <multivalue>{Add,Remove} (no hyphen)
instead of the expected <multivalue>-{Add,Remove}.
David Kalnischkies [Thu, 28 Apr 2016 07:22:55 +0000 (09:22 +0200)]
factor out Pkg/DepIterator prettyprinters into own header
The old prettyprinters have only access to the struct they pretty print,
which isn't enough usually as we want to know for a package also a bit
of state information like which version is the candidate.
We therefore need to pull the DepCache into context and hence use a
temporary struct which is printed instead of the iterator itself.
David Kalnischkies [Thu, 28 Apr 2016 07:06:39 +0000 (09:06 +0200)]
deprecate confusing Pkg.CandVersion() method
This method does not return the 'current' candidate of the DepCache
which would be most expected, but instead returns the version which
would be candidate in a default-only policy setting – aka ignoring
apt_preferences settings and co.
David Kalnischkies [Wed, 27 Apr 2016 17:39:02 +0000 (19:39 +0200)]
respect user pinning in M-A:same version (un)screwing
Using Pkg.CandVersion() here is wrong as its implementation will return
a candidate based just on the default policy settings ignoring user
preferences and otherwise set candidates (aka: it sidesteps the
pkgDepCache).
This causes M-A:same libraries to be detected as screwed even through
they aren't, so that they end up being kept back.
Reported-By: Felipe Sateler on IRC
David Kalnischkies [Wed, 27 Apr 2016 11:41:31 +0000 (13:41 +0200)]
FileFd: avoid further writing if file failed
If the file is in a failed state there is no point in trying to flush
out the buffers as the file is to be discarded anyhow & its likely all
this flushing is producing is additional error messages.
Git-Dch: Ignore
Julian Andres Klode [Wed, 27 Apr 2016 21:24:51 +0000 (23:24 +0200)]
Merge branch 'fix-https-noproxy' of github.com:patcable/apt
Patrick Cable [Wed, 27 Apr 2016 20:55:55 +0000 (16:55 -0400)]
refactored no_proxy code to work regardless of where https proxy is set
when using the https transport mechanism, $no_proxy is ignored if apt is
getting it's proxy information from $https_proxy (as opposed to
Acquire::https::Proxy somewhere in apt config). if the source of proxy
information is Acquire::https::Proxy set in apt.conf (or apt.conf.d),
then $no_proxy is honored.
Julian Andres Klode [Mon, 25 Apr 2016 19:58:10 +0000 (21:58 +0200)]
private-show: Get rid of old policy support code
This does not make much sense anymore, now that we dropped the
old candidate ver algorithm.
Julian Andres Klode [Mon, 25 Apr 2016 19:50:20 +0000 (21:50 +0200)]
policy: Remove TODO for replacing old GetCandidateVer()
Gbp-Dch: ignore
Julian Andres Klode [Mon, 25 Apr 2016 14:07:28 +0000 (16:07 +0200)]
policy: Get rid of old (pre-1.1) GetCandidateVer algorithm
Bye bye old friend. You're in one Ubuntu LTS release for compat
testing, now we do not need you anymore.
David Kalnischkies [Mon, 25 Apr 2016 14:30:43 +0000 (16:30 +0200)]
restore pinning to min/max value of short
Broken in the previous commit (
69cea1ef2cfda3c4da79fd756a8edaf2be26998e).
Adding a test and a comment to avoid future embarrassment.
Git-Dch: Ignore
Reported-By: Julian Andres Klode on IRC
David Kalnischkies [Mon, 25 Apr 2016 12:36:56 +0000 (14:36 +0200)]
give rc-status packages a pin of -1
It would previously return a pin of 0, which is an invalid value, but
the intend is that versions which are only in the dpkg/status file can't
be selected for installation (= can't be a candidate) which is what a
negative pin assures.
This helps with the communication to EDSP solvers as they neither know
about the rc-state (yet) nor that they shouldn't choose this version.
Ideally they shouldn't be told about such versions at all as there is
nothing to be solved here, but we will get there eventually.
David Kalnischkies [Mon, 25 Apr 2016 11:26:08 +0000 (13:26 +0200)]
edsp: ask policy engine for the pin of the version directly
David Kalnischkies [Fri, 15 Apr 2016 22:07:28 +0000 (00:07 +0200)]
use the same redirection mirror for all index files
Redirection services like httpredir.debian.org tend to use a set of
mirrors from which they pick a mirror at "random" for each requested
file, which is usually benefitial for the download of debs, but for the
index files this can quickly cause problems (aka hashsum mismatches) if
the two (or more) mirrors involved are only slightly out-of-sync.
This commit "resolves" this issue by using the mirror we ended up using
to get the (signed) Release file directly to get the index files
belonging to this Release file instead of asking the redirection
service which eliminates the risk of hitting out-of-sync mirrors.
As an obvious downside the redirection service can't serve partial
mirrors anymore for indexes and the download of indexes indexed in the
same Release file can't be done in parallel (from different mirrors).
This does not effect the download of non-index files like deb-files as
out-of-sync mirrors aren't a huge problem there, so the parallel
download outweights a potentially 404 error (also because this causes no
errenous downloads while hashsum mismatches download the entire file
before finding out that it was pointless).
The rational for this is that indexes are relative to the Release file.
If we would be talking about a HTML page including images, such a
behaviour is obvious and intended – not doing it means in the best case
a bunch of "useless" requests which will all be answered with a
redirect.
David Kalnischkies [Sun, 24 Apr 2016 08:35:08 +0000 (10:35 +0200)]
show more details for "Writing more data" errors, too
They are the small brothers of the hashsum mismatch, so they deserve a
similar treatment even through we have for architectual reasons not a
much to display as for hashsum mismatches for now.
David Kalnischkies [Sat, 12 Mar 2016 19:29:04 +0000 (20:29 +0100)]
show more details for "Hash Sum mismatch" errors
Users tend to report these errors with just this error message… not very
actionable and hard to figure out if this is a temporary or 'permanent'
mirror-sync issue or even the occasional apt bug.
Showing the involved hashsums and modification times should help in
triaging these kind of bugs – and eventually we will have less of them
via by-hash.
The subheaders aren't marked for translation for now as they are
technical glibberish and probably easier to deal with if not translated.
After all, our iconic "Hash Sum mismatch" is translated at least.
These additions were proposed in #817240 by Peter Palfrader.
David Kalnischkies [Sat, 12 Mar 2016 17:05:55 +0000 (18:05 +0100)]
format multiline errors properly in acquire progress
Together with the GlobalError change this allows us to add errors
spanning multiple lines, just that we control GlobalError while the
acquire progress is dealt with potentially by individual clients which
might or might not need to be adapted.
This isn't critical through as it either just works as expected anyhow
or is a minor styling thing (after all, all this commit does it add two
spaces to indent the lines a bit…).
David Kalnischkies [Sat, 12 Mar 2016 16:36:01 +0000 (17:36 +0100)]
drop empty line from fetch error
This is a duplicate of sorts of
0efb29eb36184bbe6de7b1013d1898796d94b171
which is the a lot more frequent case of this error – and also a
duplicate of this error message, just without the \n at the end.
Git-Dch: Ignore
David Kalnischkies [Sat, 12 Mar 2016 14:49:54 +0000 (15:49 +0100)]
properly format multiline error messages
David Kalnischkies [Sat, 12 Mar 2016 10:43:16 +0000 (11:43 +0100)]
sanify unused ReportMirrorFailure a tiny bit
Calling the (non-existent) reporter multiple times for the same error
with different codes for the same error (e.g. hashsum) is a bit strange.
It also doesn't need to be a public API. Ideally that would all look and
behave slightly different, but we will worry about that at the time this
is actually (planed to be) used somewhere…
Git-Dch: Ignore
David Kalnischkies [Thu, 7 Apr 2016 15:48:17 +0000 (17:48 +0200)]
don't ask server if we have entire file in partial/
We have this situation in cases were parts of the transaction are
refused (e.g. in a hashsum mismatch) and rerun the update (e.g. in the
hope that we get a mirror which is synced this time).
Previously we would ask the server with an if-range and in the best case
recieve a 416 in response (less featureful server might end up giving us
the entire file again or we get the wrong file this time giving us a
hashsum mismatch…), which is a waste of time if we know already by
checking the hashsums that we got the complete and correct file.
David Kalnischkies [Tue, 5 Apr 2016 18:37:57 +0000 (20:37 +0200)]
add dep11 files to default Release patterns
David Kalnischkies [Wed, 6 Apr 2016 10:50:26 +0000 (12:50 +0200)]
make random acquire queues work less random
Queues feeding workers like rred are created in a random pattern to get
a few of them to run in parallel – but if we already have an idling queue
we don't need to assign it to a (potentially new) random queue as that
saves us the (agruably small) overhead of starting up a new queue,
avoids adding jobs to an already busy queue while others idle and as
a bonus reduces the size of debug logs a bit.
We also keep starting new queues now until we reach our limit before
we assign work at random to them, which should give us a more effective
utilisation overall compared to potentially adding work to busy queues
while we haven't reached our queue limit yet.
Julian Andres Klode [Mon, 25 Apr 2016 13:24:02 +0000 (15:24 +0200)]
Release 1.2.11
David Kalnischkies [Thu, 14 Apr 2016 20:02:07 +0000 (22:02 +0200)]
ensure outdated files are dropped without lists-cleanup
Tested via (newly) empty index files, but effects also files dropped
from the repository or an otherwise changed repository config.