ntk/apt.git
9 years agoadd --secret-keyring option for apt-key
David Kalnischkies [Mon, 27 Jan 2014 17:26:44 +0000 (18:26 +0100)]
add --secret-keyring option for apt-key

For some advanced usecases it might be handy to specify the secret
keyring to be used (e.g. as it is used in the testcases), but specifying
it via a normal option for gnupg might not be available forever:
http://lists.gnupg.org/pipermail/gnupg-users/2013-August/047180.html

Git-Dch: Ignore

9 years agoallow to specify fingerprints in 'apt-key del'
David Kalnischkies [Mon, 27 Jan 2014 16:04:53 +0000 (17:04 +0100)]
allow to specify fingerprints in 'apt-key del'

9 years agoadd a test for apt-key export{,all}
David Kalnischkies [Mon, 27 Jan 2014 15:59:46 +0000 (16:59 +0100)]
add a test for apt-key export{,all}

Git-Dch: Ignore

9 years agouse apt-key to wrap gpg calls in testcases
David Kalnischkies [Sun, 26 Jan 2014 18:23:58 +0000 (19:23 +0100)]
use apt-key to wrap gpg calls in testcases

beside testing apt-key a bit it also avoids duplicating gpghome setup
code in apt-key and the test framework

Git-Dch: Ignore

9 years agorespect --keyring also in merged keyring commands
David Kalnischkies [Sun, 26 Jan 2014 18:14:13 +0000 (19:14 +0100)]
respect --keyring also in merged keyring commands

Git-Dch: Ignore

9 years agosupport gnupg2 as drop-in replacement for gnupg
David Kalnischkies [Sun, 26 Jan 2014 17:28:50 +0000 (18:28 +0100)]
support gnupg2 as drop-in replacement for gnupg

If both are available APT will still prefer gpg over gpg2 as it is a bit
more lightweight, but it shouldn't be a problem to use one or the other
(at least at the moment, who knows what will happen in the future).

9 years agodelay gnupg setup in apt-key until it is needed
David Kalnischkies [Sun, 26 Jan 2014 16:37:00 +0000 (17:37 +0100)]
delay gnupg setup in apt-key until it is needed

'apt-key help' and incorrect usage do not need a functioning gnupg
setup, as well as we shouldn't try to setup gnupg before we actually
test if it is available (and print a message if it is not).

9 years agocorrect the error messages to refer to apt-key instead of gpgv
David Kalnischkies [Sun, 26 Jan 2014 16:23:50 +0000 (17:23 +0100)]
correct the error messages to refer to apt-key instead of gpgv

Git-Dch: Ignore

9 years agouse apt-key adv (+ gnupg) instead of gpgv for verify
David Kalnischkies [Fri, 24 Jan 2014 22:48:11 +0000 (23:48 +0100)]
use apt-key adv (+ gnupg) instead of gpgv for verify

apt-key does the keyring merge as we need it, so we just call it instead
of reimplementing it to do the merging before gpgv. This means we don't
use gpgv anymore (we never depended on it explicitly - bad style), but
it also means that the message in apt-cdrom add is a bit less friendly
as it says loudly "untrusted key", but for a one-time command its okay.

9 years agomerge fragment keyrings in apt-key to avoid hitting gpg limits
David Kalnischkies [Fri, 24 Jan 2014 21:40:52 +0000 (22:40 +0100)]
merge fragment keyrings in apt-key to avoid hitting gpg limits

gnupg has a hardlimit of 40 (at the moment) keyrings per invocation,
which can be exceeded with (many) repositories. That is rather
misfortune as the longrun goal was to drop gnupg dependency at some
point in the future, but this can now be considered missed and dropped.

It also means that 'apt-key adv' commands might not have the behaviour
one would expect it to have as it mainly operates on a big temporary
keyring, so commands modifying keys will break. Doing this was never a
good idea anyway through, so lets just hope nothing break too badly.

Closes: 733028

9 years agorefactor key removal code to reuse it in next step
David Kalnischkies [Fri, 24 Jan 2014 17:24:43 +0000 (18:24 +0100)]
refactor key removal code to reuse it in next step

Git-Dch: Ignore

9 years agoset a primary-keyring only if we have access to it
David Kalnischkies [Fri, 24 Jan 2014 16:41:35 +0000 (17:41 +0100)]
set a primary-keyring only if we have access to it

9 years agosupport (multiple) arguments properly in apt-key
David Kalnischkies [Fri, 24 Jan 2014 16:24:56 +0000 (17:24 +0100)]
support (multiple) arguments properly in apt-key

9 years agoonly create new trusted.gpg if directory is writeable
David Kalnischkies [Fri, 24 Jan 2014 16:14:52 +0000 (17:14 +0100)]
only create new trusted.gpg if directory is writeable

9 years agoall errors should be printed to stderr
David Kalnischkies [Fri, 24 Jan 2014 15:44:49 +0000 (16:44 +0100)]
all errors should be printed to stderr

Git-Dch: Ignore

9 years agoadd a (hidden) --quiet option for apt-key
David Kalnischkies [Fri, 24 Jan 2014 15:43:19 +0000 (16:43 +0100)]
add a (hidden) --quiet option for apt-key

9 years agorename postrm to apt.postrm
David Kalnischkies [Fri, 24 Jan 2014 14:18:14 +0000 (15:18 +0100)]
rename postrm to apt.postrm

It helps in identifying its affiliation.
Also removes the old postinst which was hidden by apt.postinst for a
long time now and would just install a sources.list in edgecases which
is probably not a good idea (e.g. on my system /etc/apt/sources.list
does not exist). It is better done by the installer of the distro.

Git-Dch: Ignore

9 years agoremove leftover debug output from multikey softlink
David Kalnischkies [Fri, 24 Jan 2014 14:02:39 +0000 (15:02 +0100)]
remove leftover debug output from multikey softlink

Git-Dch: Ignore

9 years agofix: warning: extra ‘;’ [-Wpedantic]
David Kalnischkies [Fri, 26 Sep 2014 20:55:56 +0000 (22:55 +0200)]
fix: warning: extra ‘;’ [-Wpedantic]

Reported-By: gcc -Wpedantic
Git-Dch: Ignore

9 years agofix: Member variable 'X' is not initialized in the constructor.
David Kalnischkies [Fri, 26 Sep 2014 20:16:26 +0000 (22:16 +0200)]
fix: Member variable 'X' is not initialized in the constructor.

Reported-By: cppcheck
Git-Dch: Ignore

9 years agofix occurrence typo in tagfile comment
David Kalnischkies [Fri, 26 Sep 2014 19:47:59 +0000 (21:47 +0200)]
fix occurrence typo in tagfile comment

Reported-By: codespell
Git-Dch: Ignore

9 years agoremove outdated and unused po/ChangeLog
David Kalnischkies [Fri, 26 Sep 2014 19:46:41 +0000 (21:46 +0200)]
remove outdated and unused po/ChangeLog

Git-Dch: Ignore

9 years agoadd an API for cache filters/matcher
David Kalnischkies [Sun, 7 Sep 2014 17:16:56 +0000 (19:16 +0200)]
add an API for cache filters/matcher

A lot of code deals with iterating over packages and checking for
specific states. At the moment these are all handcrafted inplace, but
that makes sharing common code which just differs in the states it
checks rather difficult and is error prune. Having an API to construct
arbitrary complex filters will come in handy for those.

Git-Dch: Ignore

9 years agomove PCI::From* methods into CacheSetHelper class
David Kalnischkies [Thu, 4 Sep 2014 17:01:12 +0000 (19:01 +0200)]
move PCI::From* methods into CacheSetHelper class

The methods itself deal with the helper a lot, so it makes sense to move
them to the helper itself, which helps also if we want to override some
of these methods, the FromString mentioned in the bugreport being the
obvious example.

VCI is spared from this change for now as while it would fit with the
same reasoning it much heavier entangled with the previous
CacheSetHelper change, so moving it now would mean breaking the API.
The PCI change is worthwhile on its own though as it is used by VCI.

Closes: 686221

9 years agoadapt to the new CacheSetHelper API
David Kalnischkies [Wed, 3 Sep 2014 17:02:05 +0000 (19:02 +0200)]
adapt to the new CacheSetHelper API

Git-Dch: Ignore

9 years agorework cachesets API to allow future extension
David Kalnischkies [Wed, 3 Sep 2014 16:16:16 +0000 (18:16 +0200)]
rework cachesets API to allow future extension

The introduction of Fnmatch showed that each new selector would require
multiple new virtual methods in the CacheSetHelper to work correctly,
which isn't that great. We now flip to a single virtual method which
handles all cases separated by an enum – as new enum values can be added
without an ABI break.

Great care was taken to make old code work with the new way of organisation,
which means in return that you might be bombarded with deprecation
warnings now if you don't adapt, but code should still compile and work
as before as can be seen in apt itself with this commit.

Git-Dch: Ignore

9 years agoadd APT::PackageUniverse as a pkgCache wrapper
David Kalnischkies [Wed, 3 Sep 2014 09:11:10 +0000 (11:11 +0200)]
add APT::PackageUniverse as a pkgCache wrapper

Git-Dch: Ignore

9 years agoadd specialisations for std::vector
David Kalnischkies [Tue, 2 Sep 2014 22:26:13 +0000 (00:26 +0200)]
add specialisations for std::vector

Git-Dch: Ignore

9 years agomark pkg(All|Dist)Upgrade as deprecated
David Kalnischkies [Sun, 17 Aug 2014 11:27:59 +0000 (13:27 +0200)]
mark pkg(All|Dist)Upgrade as deprecated

The comment above their definition marks them already as such, so this
is only a formalisation of the deprecation and fixes the occurances we
have in our own code together with removing a magic number.

Git-Dch: Ignore

9 years agofix progress output for (dist-)upgrade calculation
David Kalnischkies [Sun, 17 Aug 2014 10:30:21 +0000 (12:30 +0200)]
fix progress output for (dist-)upgrade calculation

Previously, we had a start and a done of the calculation printed by
higher-level code, but this got intermixed by progress reporting from an
external solver or the output of autoremove code…

The higherlevel code is now only responsible for instantiating a
progress object of its choosing (if it wants progress after all) and the
rest will be handled by the upgrade code. Either it is used to show the
progress of the external solver or the internal solver will give some
hints about its overall progress. The later isn't really a proper
progress as it will jump forward after each substep, but that is at
least a bit better than before without any progress indication.

Fixes also the 'strange' non-display of this progress line in -q=1, while
all others are shown, which is reflected by all testcase changes.

9 years agode-duplicate version strings in the cache
David Kalnischkies [Wed, 23 Jul 2014 12:52:11 +0000 (14:52 +0200)]
de-duplicate version strings in the cache

Turns out that version numbers aren't as random as you might guess.
In my cache for example, I have:
  Total package names: 69513 (1390 k)
  Total package structures: 188259 (9036 k)
  Total distinct versions: 186345 (13.4 M)
  Total dependencies: 2052242 (57.5 M)
which amounts to 1035873 (10,1 M) strings.
Reusing version strings reduces this to 161465 (3.479 k).

This comes at a cost of course: Generation is slightly slower, but we
are still faster than what we started with and it makes room (also cache
size wise) for further changes.

9 years agodrop stored StringItems in favor of in-memory mappings
David Kalnischkies [Fri, 20 Jun 2014 19:33:56 +0000 (21:33 +0200)]
drop stored StringItems in favor of in-memory mappings

Strings like Section names or architectures are needed vary often.
Instead of writing them each time we need them, we deploy sharing for
these special strings. Until now, this was done with a linked list of
strings in which we would search, which was stored in the cache.
It turns out we can do this just as well in memory as well with a bunch
of std::map's.

In memory means here that it isn't available anymore if we have a partly
invalid cache, but that isn't much of a problem in practice as the
status file is compared to the other files we parse very small and includes
mostly duplicates, so the space we would gain by storing is more or less
equal to the size of the stored linked list…

9 years agocount strings more accurately for stats
David Kalnischkies [Fri, 20 Jun 2014 18:28:54 +0000 (20:28 +0200)]
count strings more accurately for stats

So far, only the few strings stored in stringitems were counted, but
many more strings are directly inserted into the cache. We account for
this now by identifying all these different strings and measure their
length. We are still not at the correct size of the cache in 'stats'
this way, but we are now again a bit closer.

Git-Dch: Ignore

9 years agopackages in the cache are sorted by name so noise-free
David Kalnischkies [Thu, 19 Jun 2014 10:23:10 +0000 (12:23 +0200)]
packages in the cache are sorted by name so noise-free

Commit aa0fe657e46b87cc692895a36df12e8b74bb27bb sorts the package names
in the hashtable. We make use of this already in these functions, but as
a minor sideeffect it also means that we don't have 'noise' anymore
between packages belonging to the same group. We therefore don't need to
check for a matching name in Grp.FindPkg anymore.

Git-Dch: Ignore

9 years agosearch for pkg names in the cache case-sensitive
David Kalnischkies [Thu, 19 Jun 2014 09:59:41 +0000 (11:59 +0200)]
search for pkg names in the cache case-sensitive

Package names have to be lowercase (debian-policy §5.6.1) and in as
lowlevel as these method are it would be quiet strange to treat an
invalid package "suddently" as a valid one which other tools might or
might not accept. If case-insensitivity is really needed the frontend
should ensure this rather than these methods waste cpu cycles by
default.

Git-Dch: Ignore

9 years agodeprecate Pkg->Name in favor of Grp->Name
David Kalnischkies [Thu, 19 Jun 2014 09:00:02 +0000 (11:00 +0200)]
deprecate Pkg->Name in favor of Grp->Name

They both store the same information, so this field just takes up space
in the Package struct for no good reason. We mark it "just" as deprecated
instead of instantly removing it though as it isn't misleading like
Section was and is potentially used in the wild more often.

9 years agoDisable Mth.DropPrivsOrDie() in copy.cc for now
Michael Vogt [Fri, 26 Sep 2014 15:50:18 +0000 (17:50 +0200)]
Disable Mth.DropPrivsOrDie() in copy.cc for now

Dch-Ignore: true

9 years agoRemove check for "Translation-" from pkgAcqIndex::Custom600Headers()
Michael Vogt [Thu, 25 Sep 2014 10:26:22 +0000 (12:26 +0200)]
Remove check for "Translation-" from pkgAcqIndex::Custom600Headers()

This unneeded because pkgAcqIndexTrans has its own Custom600Headers()
method.

9 years agoRevert making pkgAcquire::Item::DescURI() "const"
Michael Vogt [Thu, 25 Sep 2014 09:49:16 +0000 (11:49 +0200)]
Revert making pkgAcquire::Item::DescURI() "const"

Revert because its a API change and the gain does not justify the
extra work to make the required changes in the consumers of this
interface at this point.

9 years agoUse /var/empty as the homedir for _apt
Michael Vogt [Thu, 25 Sep 2014 09:39:16 +0000 (11:39 +0200)]
Use /var/empty as the homedir for _apt

Thanks to Axel Beckert

9 years agoreleasing package apt version 1.1~exp3
Michael Vogt [Wed, 24 Sep 2014 18:14:55 +0000 (20:14 +0200)]
releasing package apt version 1.1~exp3

9 years agoDropPrivs: Document what it does
Julian Andres Klode [Wed, 24 Sep 2014 20:28:44 +0000 (22:28 +0200)]
DropPrivs: Document what it does

Git-Dch: ignore

9 years agoDropPrivs: Use APT::Sandbox::User instead of Apt::User::Nobody
Julian Andres Klode [Wed, 24 Sep 2014 20:26:41 +0000 (22:26 +0200)]
DropPrivs: Use APT::Sandbox::User instead of Apt::User::Nobody

Git-Dch: ignore

9 years agoDropPrivs: Hard-fail if the user does not exist
Julian Andres Klode [Wed, 24 Sep 2014 20:07:27 +0000 (22:07 +0200)]
DropPrivs: Hard-fail if the user does not exist

Git-Dch: ignore

9 years agoDropPrivs: Add some comments for the more obscure setuid/setgid functions
Julian Andres Klode [Wed, 24 Sep 2014 20:00:33 +0000 (22:00 +0200)]
DropPrivs: Add some comments for the more obscure setuid/setgid functions

Git-Dch: ignore

9 years agoDropPrivs: Move the re-set uid/gid thing to the end of the function
Julian Andres Klode [Wed, 24 Sep 2014 19:53:45 +0000 (21:53 +0200)]
DropPrivs: Move the re-set uid/gid thing to the end of the function

Git-Dch: ignore

9 years agomethods: Fail if we cannot drop privileges
Julian Andres Klode [Wed, 24 Sep 2014 19:49:19 +0000 (21:49 +0200)]
methods: Fail if we cannot drop privileges

9 years agoDropPrivs: Improve comments
Julian Andres Klode [Wed, 24 Sep 2014 18:59:53 +0000 (20:59 +0200)]
DropPrivs: Improve comments

Git-Dch: ignore

9 years agoDropPrivs: Also check for saved set-user-ID and set-group-ID
Julian Andres Klode [Wed, 24 Sep 2014 18:57:30 +0000 (20:57 +0200)]
DropPrivs: Also check for saved set-user-ID and set-group-ID

9 years agoDropPrivs: Do not use an invalid return check for setgroups()
Julian Andres Klode [Wed, 24 Sep 2014 18:02:54 +0000 (20:02 +0200)]
DropPrivs: Do not use an invalid return check for setgroups()

setgroups() returns 0 on success

Git-Dch: ignore

9 years agoUse _apt as our unprivileged user name
Julian Andres Klode [Wed, 24 Sep 2014 15:29:53 +0000 (17:29 +0200)]
Use _apt as our unprivileged user name

Some people want to standardize on it, and BSDs do it too, so let's
do the same.

Reported-by: Paul Wise <pabs@debian.org>
9 years agoDropPriv: Really call seteuid and not setuid, and add more checks
Julian Andres Klode [Wed, 24 Sep 2014 14:47:55 +0000 (16:47 +0200)]
DropPriv: Really call seteuid and not setuid, and add more checks

The only thing we are missing is non-portable saved ids support.

9 years agoDrop Privileges to "Debian-apt" in most acquire methods
Michael Vogt [Wed, 24 Sep 2014 14:22:05 +0000 (16:22 +0200)]
Drop Privileges to "Debian-apt" in most acquire methods

Add a new "Debian-apt" user that owns the /var/lib/apt/lists
and /var/cache/apt/archive directories. The methods
http, https, ftp, gpgv, gzip switch to this user when they
start.

Thanks to Julian and "ioerror" and tors "switch_id()" code.

9 years agofix tests
Michael Vogt [Tue, 23 Sep 2014 12:57:10 +0000 (14:57 +0200)]
fix tests

9 years agoMerge branch 'debian/sid' into debian/experimental
Michael Vogt [Tue, 23 Sep 2014 12:20:27 +0000 (14:20 +0200)]
Merge branch 'debian/sid' into debian/experimental

Conflicts:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/cachefilter.h
configure.ac
debian/changelog

9 years agoEnsure that iTFRewritePackageOrder is "MD5sum" to match apt-ftparchive
Michael Vogt [Sun, 21 Sep 2014 19:40:10 +0000 (21:40 +0200)]
Ensure that iTFRewritePackageOrder is "MD5sum" to match apt-ftparchive

The iTFRewritePackageOrder is used in indexcopy to copy and normalize
cdrom Packages files. This change will ensure that there is no
"normalization" that changes MD5sum -> MD5Sum which alters the hash
of the Packages file on disk (oh the irony).

9 years agoFix regression for cdrom: sources from latest security update
Michael Vogt [Sun, 21 Sep 2014 19:23:04 +0000 (21:23 +0200)]
Fix regression for cdrom: sources from latest security update

Skip a reverify for cdrom: sources. The reverify step is actually
harmful here because the apt-cdrom add code uses the indexcopy.cc
which will "normalize" the Packages file from the cdrom when it
writes it to the local disk. This leads to changing the "MD5sum"
field (notice the lower case "s") on the cdrom Packages file to
a "MD5Sum" field on the local file in /var/lib/apt/lists. Which
of course alters the hash and makes apt fail to reverify the file.

9 years agorelax grep to support newer curl output format
David Kalnischkies [Fri, 19 Sep 2014 22:12:13 +0000 (00:12 +0200)]
relax grep to support newer curl output format

Git-Dch: Ignore

9 years agodisable timestamps in the footer of docs by doxygen
Jérémy Bobbio [Fri, 19 Sep 2014 21:03:55 +0000 (23:03 +0200)]
disable timestamps in the footer of docs by doxygen

The default being 'yes', but this spoils the effort of reproducible
builds for no real gain. (https://wiki.debian.org/ReproducibleBuilds)

9 years agoGerman program translation update
Holger Wansing [Fri, 19 Sep 2014 20:32:14 +0000 (22:32 +0200)]
German program translation update

Closes: 762223

9 years agoFix regression when copy: is used for a relative path
Michael Vogt [Fri, 19 Sep 2014 14:41:55 +0000 (16:41 +0200)]
Fix regression when copy: is used for a relative path

When we do a ReverifyAfterIMS() we use the copy: method to
verify the hashes again. If the user uses -o Dir=./something/relative
this fails because we use the URI class in copy.cc that strips
away the leading relative part. By not using URI this is fixed.

Closes: #762160

9 years agotest/integration/test-apt-update-file: improve test
Michael Vogt [Fri, 19 Sep 2014 14:41:50 +0000 (16:41 +0200)]
test/integration/test-apt-update-file: improve test

9 years ago./pre-release pre-export
Michael Vogt [Thu, 18 Sep 2014 05:59:01 +0000 (07:59 +0200)]
./pre-release pre-export

9 years agoreleasing package apt version 1.0.9.1 1.0.9.1
Michael Vogt [Wed, 17 Sep 2014 20:05:51 +0000 (22:05 +0200)]
releasing package apt version 1.0.9.1

9 years agoMerge remote-tracking branch 'vnwildman/debian/sid' into debian/sid
Michael Vogt [Wed, 17 Sep 2014 20:04:30 +0000 (22:04 +0200)]
Merge remote-tracking branch 'vnwildman/debian/sid' into debian/sid

9 years agoimprove test for commit daff4a
Michael Vogt [Wed, 17 Sep 2014 15:48:27 +0000 (17:48 +0200)]
improve test for commit daff4a

9 years agoFix regression for file:/// uris from CVE-2014-0487
Michael Vogt [Wed, 17 Sep 2014 12:57:05 +0000 (14:57 +0200)]
Fix regression for file:/// uris from CVE-2014-0487

Do not run ReverifyAfterIMS() for local file URIs as this will
causes apt to mess around in the file:/// uri space. This is
wrong in itself, but it will also cause a incorrect verification
failure when the archive and the lists directory are on different
partitions as rename().

9 years agoprepare 1.0.9.1
Michael Vogt [Tue, 16 Sep 2014 18:53:35 +0000 (20:53 +0200)]
prepare 1.0.9.1

9 years agomerge previous upload
Michael Vogt [Tue, 16 Sep 2014 18:51:19 +0000 (20:51 +0200)]
merge previous upload

9 years agoSECURITY UPDATE for CVE-2014-{0488,0487,0489}
Michael Vogt [Tue, 16 Sep 2014 18:23:43 +0000 (20:23 +0200)]
SECURITY UPDATE for CVE-2014-{0488,0487,0489}

incorrect invalidating of unauthenticated data (CVE-2014-0488)
incorect verification of 304 reply (CVE-2014-0487)
incorrect verification of Acquire::Gzip indexes (CVE-2014-0489)

9 years agoadd a 'coverage' command to generate reports
David Kalnischkies [Sun, 14 Sep 2014 20:48:01 +0000 (22:48 +0200)]
add a 'coverage' command to generate reports

Builds, runs and generates everything needed to have a coverage report
at the end for apt. The report isn't perfect as most childs apt forks do
not have a regular exit and so data is never written for them, which
results in e.g. most methods to have zero coverage reported.

Git-Dch: Ignore

9 years agoTurkish program translation update
Mert Dirik [Sun, 14 Sep 2014 21:04:03 +0000 (23:04 +0200)]
Turkish program translation update

Closes: 761394

9 years agoUpdated German documentation translation
Chris Leick [Sun, 14 Sep 2014 12:48:10 +0000 (14:48 +0200)]
Updated German documentation translation

9 years agol10n: vi.po (636t): Update program translation
Trần Ngọc Quân [Fri, 12 Sep 2014 07:13:36 +0000 (14:13 +0700)]
l10n: vi.po (636t): Update program translation

Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
9 years agoAllow override of Proxy-Auto-Detect by the users configuration
Michael Vogt [Fri, 12 Sep 2014 09:44:11 +0000 (11:44 +0200)]
Allow override of Proxy-Auto-Detect by the users configuration

Only run the Proxy-Auto-Detect code if there is not already
a host specific configuration.

Closes: 759264

9 years agoprepare 1.0.8 1.0.8
Michael Vogt [Tue, 9 Sep 2014 18:10:41 +0000 (20:10 +0200)]
prepare 1.0.8

9 years agodebian/gbp.conf: use export-dir
Michael Vogt [Tue, 9 Sep 2014 18:50:34 +0000 (20:50 +0200)]
debian/gbp.conf: use export-dir

9 years agodon't call pager in non-terminals for changelog
David Kalnischkies [Tue, 9 Sep 2014 11:52:32 +0000 (13:52 +0200)]
don't call pager in non-terminals for changelog

Most pagers are nice and default to running non-interactively if they
aren't connected to a terminal and we relied on that. On ci.debian.net
the configured pager is printing a header out of nowhere though, so if
we are printing to a non-terminal we call "cat" instead.

In the rework we also "remove" the dependency on sensible-utils in sofar
as we call some alternatives if calling the utils fail.

This seems to be the last problem preventing a "PASS" status on
ci.debian.net, so we close the associated bugreport.

Closes: 755040

9 years agorework PTY magic to fix stair-stepping on kfreebsd
David Kalnischkies [Mon, 8 Sep 2014 19:05:11 +0000 (21:05 +0200)]
rework PTY magic to fix stair-stepping on kfreebsd

A pty slave we have got from openpty can only be used for one dpkg
child, if we give it to a second child on kfreebsd setting TIOCSCTTY
fails causing the output to be stair-stepped from now on.

By switching the code to creating a master and opening a new slave in
the child for each child we can fix this glitch, so that at least the
master remains stable.

Closes: 759684

9 years agofix progress report for upgrade and reinstall
David Kalnischkies [Mon, 8 Sep 2014 15:14:17 +0000 (17:14 +0200)]
fix progress report for upgrade and reinstall

APT treats upgrades like installs and dpkg is very similar in this, but
prints still a slightly different processing message indicating that it
is really an upgrade which we hadn't parsed so far, but this wasn't
really visible as we quickly moved on to a 'known' state.

More problematic was the reinstall case as apt hadn't recognized this
for the package name detection, so that reinstalls had no progress since
we introduced MultiArch.

9 years agofix and non-silent fail dpkg-overwrite error test
David Kalnischkies [Sun, 7 Sep 2014 20:08:01 +0000 (22:08 +0200)]
fix and non-silent fail dpkg-overwrite error test

Commit cbcdd3ee9d86379d1b3a44e41ae8b17dc23111d0 removes the space at the
end of the debfile name dpkg send to us and we previously had included
in the pmerror message we printed on the statusfd.

Git-Dch: Ignore

9 years agostrip everything spacey in APT::String::Strip
David Kalnischkies [Sun, 7 Sep 2014 19:27:57 +0000 (21:27 +0200)]
strip everything spacey in APT::String::Strip

Git-Dch: Ignore

9 years agodetect terminal output with 'test -t' in tests
David Kalnischkies [Sun, 7 Sep 2014 17:30:33 +0000 (19:30 +0200)]
detect terminal output with 'test -t' in tests

Instead of trying to inspect /proc and the fds inside we use "test -t 1"
instead as this is available and working on kfreebsd as well – not that
something breaks if we wouldn't, but we like color.

Git-Dch: Ignore

9 years agodo use an 'unknown' arch-specification in test
David Kalnischkies [Sun, 7 Sep 2014 17:28:21 +0000 (19:28 +0200)]
do use an 'unknown' arch-specification in test

Using 'kfreebsd' here makes the test fail on a kfreebsd system
(obviously), so we just use something totally madeup in the hope that
this is less like to conflict in the future.

Git-Dch: Ignore

9 years agomake GetLocalitySortedVersionSet more generic
David Kalnischkies [Tue, 2 Sep 2014 16:20:49 +0000 (18:20 +0200)]
make GetLocalitySortedVersionSet more generic

No reason in and of by itself at the moment, but prepares for the goal
of having 'apt search' and 'apt-cache search' using the same code now
that they at least support the same stuff. The 'apt' code is just a
multitude slower at the moment…

Git-Dch: Ignore

9 years agoimplement --full in apt search
David Kalnischkies [Tue, 2 Sep 2014 12:32:48 +0000 (14:32 +0200)]
implement --full in apt search

9 years agouse a format string in ListSingleVersion
David Kalnischkies [Mon, 1 Sep 2014 19:43:15 +0000 (21:43 +0200)]
use a format string in ListSingleVersion

The method already deals with a format string, but had an else path
doing a hardcoded format as well. This is changed now to use the same
code for both - the format in the second case is still fixed though.

Git-Dch: Ignore

9 years agoskip version if we already have this package as search-result
David Kalnischkies [Mon, 1 Sep 2014 17:09:40 +0000 (19:09 +0200)]
skip version if we already have this package as search-result

Git-Dch: Ignore

9 years agosupport regular expressions in 'apt search'
David Kalnischkies [Sat, 30 Aug 2014 09:29:45 +0000 (11:29 +0200)]
support regular expressions in 'apt search'

apt-cache search supported this since ever and in the code for apt was a
fixme indicating this should be added here as well, so here we go.

9 years agoImprove Debug::Acquire::http debug output
Michael Vogt [Fri, 5 Sep 2014 14:24:32 +0000 (16:24 +0200)]
Improve Debug::Acquire::http debug output

Prefix all answers with the URL that the answer is for. This
helps when debugging and pipeline is enabled.

9 years agoMerge branch 'debian/sid' into debian/experimental
Michael Vogt [Fri, 5 Sep 2014 12:41:54 +0000 (14:41 +0200)]
Merge branch 'debian/sid' into debian/experimental

Conflicts:
apt-pkg/acquire-item.cc
configure.ac
debian/changelog
doc/apt-verbatim.ent
doc/po/apt-doc.pot
doc/po/de.po
doc/po/es.po
doc/po/fr.po
doc/po/it.po
doc/po/ja.po
doc/po/pt.po
po/ar.po
po/ast.po
po/bg.po
po/bs.po
po/ca.po
po/cs.po
po/cy.po
po/da.po
po/de.po
po/dz.po
po/el.po
po/es.po
po/eu.po
po/fi.po
po/fr.po
po/gl.po
po/hu.po
po/it.po
po/ja.po
po/km.po
po/ko.po
po/ku.po
po/lt.po
po/mr.po
po/nb.po
po/ne.po
po/nl.po
po/nn.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ro.po
po/ru.po
po/sk.po
po/sl.po
po/sv.po
po/th.po
po/tl.po
po/tr.po
po/uk.po
po/vi.po
po/zh_CN.po
po/zh_TW.po
test/integration/test-ubuntu-bug-346386-apt-get-update-paywall

9 years agoEnsure we have a Policy in CacheFile.BuildDepCache()
Michael Vogt [Fri, 5 Sep 2014 10:50:15 +0000 (12:50 +0200)]
Ensure we have a Policy in CacheFile.BuildDepCache()

This partly reverts d059cc2 and fixes bug #753297 in a more
general way by ensuring that CacheFile.BuildDepCache() builds
a pkgPolicy if there isn't one already.

9 years agoFix incorrect upgradable listing in "apt list" (thanks to Michael Musenbrock)
Michael Vogt [Fri, 5 Sep 2014 10:03:28 +0000 (12:03 +0200)]
Fix incorrect upgradable listing in "apt list" (thanks to Michael Musenbrock)

The "apt list" command was using only the pkgDepCache but not the
pkgPolicy to figure out if a package is upgradable. This lead to
incorrect display of upgradable package when the user used the
policy to pin-down packages. Thanks to Michael Musenbrock for the
initial patch.

Closes: #753297

9 years agotest/integration/test-ubuntu-bug-346386-apt-get-update-paywall: use downloadfile()
Michael Vogt [Wed, 3 Sep 2014 14:54:16 +0000 (16:54 +0200)]
test/integration/test-ubuntu-bug-346386-apt-get-update-paywall: use downloadfile()

9 years agoRun autopkgtest tests with "env -i" to avoid pollution from the host env
Michael Vogt [Tue, 2 Sep 2014 15:30:45 +0000 (17:30 +0200)]
Run autopkgtest tests with "env -i" to avoid pollution from the host env

Closes: #759655

9 years agoMake Packages & Sources generation optional, during Generate call
Dimitri John Ledkov [Fri, 18 Jul 2014 15:06:34 +0000 (16:06 +0100)]
Make Packages & Sources generation optional, during Generate call

refactor a bit, extract code out of Generate() into
DoGenerate{PackagesAndSources,Contents}, add new
APT::FTPArchive::ContentsOnly option to allow skipping the generation
of Package/Source files (if they are generated e.g. by some db outside
of apt-ftparchives control)

9 years agoUse heap to allocate PatternMatch to avoid potential stack overflow
Michael Vogt [Tue, 2 Sep 2014 15:06:52 +0000 (17:06 +0200)]
Use heap to allocate PatternMatch to avoid potential stack overflow

When apt-cache search with many args (> 130) is given the allocation
of PatternMatch on the stack may fail resulting in a segmentation
fault. By using the heap the max size is much bigger and we also
get a bad_alloc expection instead of a segfault (which we can catch
*if* this ever becomes a pratical problem). No test for the crash
as its not reproducable with the MALLOC_ settings in framework.

Closes: 759612

9 years ago* apt-pkg/deb/dpkgpm.cc:
Michael Vogt [Tue, 2 Sep 2014 15:24:24 +0000 (17:24 +0200)]
* apt-pkg/deb/dpkgpm.cc:
    - update string matching for dpkg I/O errors. (LP: #1363257)
    - properly parse the dpkg status line so that package name is properly set
      and an apport report is created. Thanks to Anders Kaseorg for the patch.
      (LP: #1353171)

9 years agoAdd testcase for apt list --all-versions
Michael Vogt [Tue, 2 Sep 2014 14:36:32 +0000 (16:36 +0200)]
Add testcase for apt list --all-versions

Dch-Ignore: true

9 years agoAvoid yielding blank lines with APT::Cmd::use-format=true
Andreas Oberritter [Tue, 2 Sep 2014 14:34:05 +0000 (16:34 +0200)]
Avoid yielding blank lines with APT::Cmd::use-format=true