Michael Vogt [Wed, 12 Feb 2014 06:59:07 +0000 (07:59 +0100)]
Use a APT::VersionSet instead of a VersionList
Use a APT::VersionSet instead of a APT::VersionList in DoDownload()
to ensure that there is only one version in the set even if the
user passes multiple identical name/versions on the commandline
(Bug#738103)
John Ogness [Fri, 13 Dec 2013 19:59:31 +0000 (20:59 +0100)]
apt-cdrom should succeed if any drive succeeds
If there are multiple CD-ROM drives, `apt-cdrom add` will abort with an
error if any of the drives do not contain a Debian CD which is against
the documentation we have saying "a CD-ROM" and also scripts do not
expect it this way.
This patch modifies apt-cdrom to return success if any of the drives
succeeded. If failures occur, apt-cdrom will still continue trying all
the drives and report the last failure (if none of them succeeded).
The 'ident' command was also changed to match the new 'add' behavior.
cppcheck complains about the obsolete utime as it was removed in
POSIX1.2008 and recommends usage of utimensat/futimens instead
as those are in POSIX and so commit 9ce3cfc9 switched to them.
It is just that they aren't as portable as the standard suggests:
At least our kFreeBSD and Hurd ports stumble over it at runtime.
So to make both, the ports and cppcheck happy, we use utimes instead.
With APT::Get::List-Cleanup disabled the ed-style patch files are
lingering in the lists/ directory otherwise. That was kinda okay in the
old none-client-merge as the filename was always the same so it was
constantly overridden, but now with different names for client-merge
quiet a few could pill up on the system and are used by the next call
as it picks them up based on the filename.
Very few methods we have are documented, so this is A LOT of noise
hidden the "interesting" warnings about methods which are documented,
but incorrectly and such stuff.
Does the same as before, but is a bit simpler on the logic for humans as
well as compilers. scan-build complained about it at least with:
"Result of operation is garbage or undefined"
Colin Watson [Thu, 30 Jan 2014 14:08:08 +0000 (14:08 +0000)]
multicompress with externals sets wrong file modes
Copy from the bug description:
After we upgraded the Ubuntu master archive from lucid to precise, we
noticed that Translation-en.bz2 was being written with mode 0600 rather
than 0644, which broke our mirroring. This is no longer reproducible as
such in unstable because apt now links against libbz2, but it's still
reproducible with xz; it happens because multicompress fchmods one end
of the compression pipe in this case rather than the target file.
[Original testcase slightly modified to comply with house-style]
If a (Pre-)Depends can't be satisfied there is no point in keeping the
candidate as is as it is impossible to find a solution for it, so we can
just as well reset the candidate to the currently installed version.
We avoid trying to install this impossible candidate later on this way.
The offset variable in DebSrcRecordParser was not initialized which we
now do and based on it do not trigger a restart if the parser was not
used yet avoiding a needless rescan of the section.
Detected while working on the previous commit e62aa1dd. Both commits act
as a "fix" for the bug shown in the testcase of the commit – this one
here would only hide it through.
pkgTagFile: if we have seen the end, do not try to see more
Asking for more via Step() will notice that we are done with the file
already and will result in a fail, which means we can't find the last
sections anymore (which is especially painful if we haven't moved at
all as in the testcase we haven't even looked at one of the sources
leading to a strange behaviour)
Michael Vogt [Fri, 24 Jan 2014 19:33:02 +0000 (20:33 +0100)]
add "apt full-upgrade" and tweak "apt upgrade"
There is a new "apt full-upgrade" that performs a apt-get dist-upgrade.
"apt dist-upgrade" is still supported as a alias. The "apt upgrade" code
is changed so that it mirrors the behavior of
"apt-get upgrade --with-new-pkgs" and also honors
"apt uprade --no-new-pkgs".
Michael Vogt [Sat, 18 Jan 2014 20:10:58 +0000 (21:10 +0100)]
* implement deb822 suggestions from donkult (thanks!):
- rename "Dist" to "Suites"
- rename "Section" to "Sections"
- rename "Architectures-Delete" to "Architectures-Remove"
- rename "Uri" to "URI"
* add "apt list --manual-installed"
* add "apt upgrade --dist"
* add "apt purge"
* flock() the file edited in "apt edit-sources"
* apt-private/private-show.cc:
- do not show Description-lang: header
* reword apt !isatty() warning
* add missing integration test for "apt list" and fix bugs
found by it
Without a PTY attached do not use color, but use the same MSGLEVEL with
or without a PTY. The level is better adjust via flags – especially as
it is likely that without a PTY you want fullblown logs instead of
the reduced display you get with -q otherwise.
otherwise you get with pickier umasks errors like:
dpkg-deb: error: control directory has bad permissions 700 (must be
>=0755 and <=0775)
so we just force a 755 for the control directory and dpkg is happy.
Maintaining (mainly the deletion of them) is a pain and they litter /tmp
while the testcase is run for no good reason as we could just as well
drop it into our tmpdir we have anyway and let them be deleted with the
rest automatically
improve stdout/stderr usage correctness in test framework
Also adds a friendly note about how many tests were run/passed so that
the end of the testrun isn't all that negative by just showing fails.
(It now tells us that we have 111 tests at the moment!)
integrate Anthonys rred with POC for client-side merge
Providing the benefits of both without the downsides :)
(ABI breaks or external dependencies)
For this Anthonys rred is equipped with:
- magic-filename-pickup of patches rather than explicit messages
- use of FileFd instead of FILE* to get on-the-fly uncompress
of the gzip compressed pdiff patches
The acquire code in turn stops checking for apt-file's helper
as our own rred is now clever enough for our needs.