]> git.saurik.com Git - apt.git/log
apt.git
10 years agocorrect 'apt-cache stats' to include more
David Kalnischkies [Fri, 13 Jun 2014 07:10:11 +0000 (09:10 +0200)] 
correct 'apt-cache stats' to include more

It still doesn't reflect the size the cache has on the disk compared to
what is given as total size (90 vs 103 MB), but by counting all structs
in we are at least a bit closer to the reality.

Git-Dch: ignore

10 years agoremove the Section member from package struct
David Kalnischkies [Fri, 13 Jun 2014 06:35:32 +0000 (08:35 +0200)] 
remove the Section member from package struct

A version belongs to a section and has hence a section member of its
own. A package on the other hand can have multiple versions from
different sections. This was "solved" by using the section which was
parsed first as order of sources.list defines, but that is obviously a
horribly unpredictable thing.

We therefore directly remove this struct member to free some space and
mark the access method as deprecated, which is told to return the
section of the 'newest' known version, which is at least predictable,
but possible not what it returned before – but nobody knows.

Users are way better of with the Section() as returned by the version
they are dealing with. It is likely the same for all versions of a
package, but in the few cases it isn't, it is important (like packages
moving from main/* to contrib/* or into oldlibs …).

10 years agocleanup datatypes mix used in binary cache
David Kalnischkies [Thu, 12 Jun 2014 10:22:45 +0000 (12:22 +0200)] 
cleanup datatypes mix used in binary cache

We had a wild mixture of (unsigned) int, long and long long here without
much sense, so this commit adds a few typedefs to get some sense in the
typesystem and ensures that a ID isn't sometimes computed as int, stored
as long and compared with a long long… as this could potentially bite us
later on as the size of the archive only increases over time.

10 years agoincrease hashtable size for packages/groups by factor 5
David Kalnischkies [Wed, 11 Jun 2014 18:42:16 +0000 (20:42 +0200)] 
increase hashtable size for packages/groups by factor 5

It also makes the size configureable, so it can be adapted in the future
without the need for an abi break - and even by users…

The increase was long overdue as it gives a >10% decrease in runtime of
e.g. 'apt-get check -s'. Some (useless) benchmark with 69933 groups and
187796 packages without a pre-built cache:
time apt-get check -so APT::Cache-HashTableSize=1 → 20m
time apt-get check -so APT::Cache-HashTableSize=1000 → 6,41s
time apt-get check -so APT::Cache-HashTableSize=2000 → 5,64s (old)
time apt-get check -so APT::Cache-HashTableSize=3000 → 5,30s
time apt-get check -so APT::Cache-HashTableSize=5000 → 5,08s
time apt-get check -so APT::Cache-HashTableSize=6000 → 5,05s
time apt-get check -so APT::Cache-HashTableSize=7000 → 5,02s
time apt-get check -so APT::Cache-HashTableSize=8000 → 5,00s
time apt-get check -so APT::Cache-HashTableSize=9000 → 4,98s
time apt-get check -so APT::Cache-HashTableSize=10000 → 4,96s (new)
time apt-get check -so APT::Cache-HashTableSize=15000 → 4,90s
time apt-get check -so APT::Cache-HashTableSize=20000 → 4,86s
time apt-get check -so APT::Cache-HashTableSize=30000 → 4,77s
time apt-get check -so APT::Cache-HashTableSize=40000 → 4,74s
time apt-get check -so APT::Cache-HashTableSize=50000 → 4,73s
time apt-get check -so APT::Cache-HashTableSize=60000 → 4,71s

The gap increases further for operations which have more package
lookups. Factor 5 was chosen as higher values do not provide any
really significant timing advantage anymore compared to the memory
increase in my testing and there is always the possibility to increase
it now if that changes. (also most users will not have 3 releases and
4 architectures in the cache, so theirs will be much smaller and faster).

10 years agoMerge remote-tracking branch 'donkult/debian/sid' into debian/experimental
Michael Vogt [Wed, 18 Jun 2014 09:21:35 +0000 (11:21 +0200)] 
Merge remote-tracking branch 'donkult/debian/sid' into debian/experimental

Conflicts:
apt-private/private-install.cc

10 years agoEDSP doc: some typo and wording fixes
David Kalnischkies [Tue, 17 Jun 2014 17:25:03 +0000 (19:25 +0200)] 
EDSP doc: some typo and wording fixes

Git-Dch: Ignore

10 years agoEDSP doc: (minor) consistently use 2 blank lines before headings
Stefano Zacchiroli [Tue, 17 Jun 2014 15:04:09 +0000 (17:04 +0200)] 
EDSP doc: (minor) consistently use 2 blank lines before headings

Git-Dch: Ignore

10 years agoEDSP doc: clarify that Install/Remove packages are arch-qualified
Stefano Zacchiroli [Tue, 17 Jun 2014 15:03:27 +0000 (17:03 +0200)] 
EDSP doc: clarify that Install/Remove packages are arch-qualified

10 years agodo not call resolver twice on (dist-)upgrade
David Kalnischkies [Tue, 17 Jun 2014 17:05:53 +0000 (19:05 +0200)] 
do not call resolver twice on (dist-)upgrade

10 years agoshow our broken packages message in 'apt' solver
David Kalnischkies [Tue, 17 Jun 2014 15:45:33 +0000 (17:45 +0200)] 
show our broken packages message in 'apt' solver

10 years agofix SubstVar to be usable as a replace_all method
David Kalnischkies [Tue, 17 Jun 2014 14:55:19 +0000 (16:55 +0200)] 
fix SubstVar to be usable as a replace_all method

The name suggests that it is supposed to substitute a variable with a
value, but we tend to use it in a more liberal replace_all() fashion,
but this breaks if either of the parameters is empty or more importantly
if two "variable" occurrences follow each other directly.

10 years agodon't send pkg from an unknown architecture via EDSP
David Kalnischkies [Tue, 17 Jun 2014 11:47:01 +0000 (13:47 +0200)] 
don't send pkg from an unknown architecture via EDSP

APT's cache can include packages from architectures dpkg has no
knowledge about and can therefore not be installed for e.g. to allow
easy lookups. There is no point in telling external solvers about them
though and some of them might even be really talkative about ignoring
them if we do.

10 years agouse P_ instead of ngettext to compiling with --disable-nls
Fredrik Fornwall [Tue, 17 Jun 2014 09:33:00 +0000 (11:33 +0200)] 
use P_ instead of ngettext to compiling with --disable-nls

Closes: 751857
10 years agoadd missing comma in SEE ALSO of apt-secure manpage
Konstantin Manna [Sun, 15 Jun 2014 16:35:15 +0000 (18:35 +0200)] 
add missing comma in SEE ALSO of apt-secure manpage

Closes: 748506
10 years agofix two german manpage spelling mistakes
Konstantin Manna [Sat, 14 Jun 2014 22:53:04 +0000 (00:53 +0200)] 
fix two german manpage spelling mistakes

Closes: 751635
10 years agoMerge remote-tracking branch 'mvo/feature/drop-rights' into debian/experimental
Michael Vogt [Wed, 18 Jun 2014 08:47:19 +0000 (10:47 +0200)] 
Merge remote-tracking branch 'mvo/feature/drop-rights' into debian/experimental

Conflicts:
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/fileutl.h

10 years agoMerge remote-tracking branch 'mvo/feature/update-by-hash' into debian/experimental
Michael Vogt [Wed, 18 Jun 2014 08:46:08 +0000 (10:46 +0200)] 
Merge remote-tracking branch 'mvo/feature/update-by-hash' into debian/experimental

10 years agoMerge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimental
Michael Vogt [Wed, 18 Jun 2014 08:13:01 +0000 (10:13 +0200)] 
Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimental

Conflicts:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/deb/debmetaindex.h
apt-pkg/pkgcache.cc
test/integration/test-apt-ftparchive-src-cachedb

10 years agoProvide ShowHashTableStats function
Michael Vogt [Wed, 18 Jun 2014 07:36:48 +0000 (09:36 +0200)] 
Provide ShowHashTableStats function

10 years ago[API-Break] rename pkgCache::Package::NextPackage to pkgCache::Package::Next
Michael Vogt [Wed, 18 Jun 2014 07:35:53 +0000 (09:35 +0200)] 
[API-Break] rename pkgCache::Package::NextPackage to pkgCache::Package::Next

This is a internal struct not a external interface so the actual
breakage should be small.

10 years agoimprove formating of the hash stats
Michael Vogt [Wed, 18 Jun 2014 06:51:59 +0000 (08:51 +0200)] 
improve formating of the hash stats

10 years agoMerge remote-tracking branch 'mvo/debian/sid' into debian/sid
Michael Vogt [Wed, 18 Jun 2014 06:32:59 +0000 (08:32 +0200)] 
Merge remote-tracking branch 'mvo/debian/sid' into debian/sid

10 years agoMerge branch 'debian/sid' into debian/experimental
Michael Vogt [Wed, 18 Jun 2014 06:32:47 +0000 (08:32 +0200)] 
Merge branch 'debian/sid' into debian/experimental

Conflicts:
debian/changelog

10 years agoTell the user if no updates are available after apt update
Michael Vogt [Wed, 18 Jun 2014 06:25:16 +0000 (08:25 +0200)] 
Tell the user if no updates are available after apt update

Thanks to Jakub Wilk for the suggestion.

Closes: #751388
10 years agoMerge remote-tracking branch 'mvo/debian/sid' into debian/sid
Michael Vogt [Wed, 18 Jun 2014 06:14:08 +0000 (08:14 +0200)] 
Merge remote-tracking branch 'mvo/debian/sid' into debian/sid

10 years agoUpdated translation of german documentation
Chris Leick [Tue, 17 Jun 2014 19:05:41 +0000 (21:05 +0200)] 
Updated translation of german documentation

10 years agoCheck for gtest's header before building.
Michele Orrù [Tue, 17 Jun 2014 09:42:31 +0000 (11:42 +0200)] 
Check for gtest's header before building.

Add AC_CHECK_HEADER directive for gtest, and report a fatal error message if not
found.

10 years agotest/integration/test-essential-force-loopbreak: fix on non-amd64 systems
Michael Vogt [Thu, 12 Jun 2014 08:09:24 +0000 (10:09 +0200)] 
test/integration/test-essential-force-loopbreak: fix on non-amd64 systems

10 years agofix test-apt-ftparchive-cachedb-lp1274466 and apt-internal-solver tests
Michael Vogt [Wed, 11 Jun 2014 16:17:45 +0000 (18:17 +0200)] 
fix test-apt-ftparchive-cachedb-lp1274466 and apt-internal-solver tests

10 years agoDropPrivs in the solvers (just to be on the safe side)
Michael Vogt [Wed, 11 Jun 2014 13:31:38 +0000 (15:31 +0200)] 
DropPrivs in the solvers (just to be on the safe side)

10 years agofix autopkgtest tests
Michael Vogt [Wed, 11 Jun 2014 12:50:48 +0000 (14:50 +0200)] 
fix autopkgtest tests

10 years agoreally release 1.0.4 1.0.4
Michael Vogt [Tue, 10 Jun 2014 16:27:34 +0000 (18:27 +0200)] 
really release 1.0.4

10 years agorelease 1.0.4
Michael Vogt [Tue, 10 Jun 2014 13:59:15 +0000 (15:59 +0200)] 
release 1.0.4

10 years agoapt-private/private-output.cc: fix cppcheck output
Michael Vogt [Tue, 10 Jun 2014 13:22:53 +0000 (15:22 +0200)] 
apt-private/private-output.cc: fix cppcheck output

10 years agofix test/integration/test-apt-ftparchive-cachedb-lp1274466 in travis
Michael Vogt [Tue, 10 Jun 2014 13:21:30 +0000 (15:21 +0200)] 
fix test/integration/test-apt-ftparchive-cachedb-lp1274466 in travis

10 years agouse pkgSrcRecords::Step() instead of Next()
Michael Vogt [Tue, 10 Jun 2014 13:07:15 +0000 (15:07 +0200)] 
use pkgSrcRecords::Step() instead of Next()

10 years agoprepare 1.0.4 upload
Michael Vogt [Tue, 10 Jun 2014 12:59:58 +0000 (14:59 +0200)] 
prepare 1.0.4 upload

10 years agoMerge remote-tracking branch 'mvo/feature/apt-update-info' into debian/sid
Michael Vogt [Tue, 10 Jun 2014 12:49:58 +0000 (14:49 +0200)] 
Merge remote-tracking branch 'mvo/feature/apt-update-info' into debian/sid

10 years agoMerge remote-tracking branch 'mvo/bugfix/apt-get-source-unauthenticated-warning'...
Michael Vogt [Tue, 10 Jun 2014 12:47:03 +0000 (14:47 +0200)] 
Merge remote-tracking branch 'mvo/bugfix/apt-get-source-unauthenticated-warning' into debian/sid

10 years agoMerge remote-tracking branch 'mvo/bugfix/lp1274466-cache' into debian/sid
Michael Vogt [Tue, 10 Jun 2014 12:46:02 +0000 (14:46 +0200)] 
Merge remote-tracking branch 'mvo/bugfix/lp1274466-cache' into debian/sid

10 years agoMerge remote-tracking branch 'mvo/feature/srcrec-enum2' into debian/sid
Michael Vogt [Tue, 10 Jun 2014 12:43:56 +0000 (14:43 +0200)] 
Merge remote-tracking branch 'mvo/feature/srcrec-enum2' into debian/sid

10 years agosupport Acquire::GzipIndexes in dumpavail
David Kalnischkies [Tue, 10 Jun 2014 12:12:12 +0000 (14:12 +0200)] 
support Acquire::GzipIndexes in dumpavail

Closes: 742835
10 years agoseparate implementation from declaration of TryTo{Install,Remove}
David Kalnischkies [Mon, 9 Jun 2014 13:50:20 +0000 (15:50 +0200)] 
separate implementation from declaration of TryTo{Install,Remove}

Git-Dch: Ignore

10 years agoadd pkgSrcRecords::Next() to step through all the pkgSrcRecords
Michael Vogt [Mon, 9 Jun 2014 07:06:07 +0000 (09:06 +0200)] 
add pkgSrcRecords::Next() to step through all the pkgSrcRecords

10 years agodo not revert candidate for protected packages
David Kalnischkies [Sat, 7 Jun 2014 20:46:37 +0000 (22:46 +0200)] 
do not revert candidate for protected packages

In commit 21b3eac8 I promoted the check for installable dependencies to
a pre-install check, which also reverts to a known good candidate (the
installed version) if it fails. This revert was done even for user
requested candidate switches which disabled our Broken detection so that
install requests which are impossible to satisfy do not fail anymore,
but print an (incomplete) solution proposal and then exit successfully.

Closes: 745046
10 years agoItalian program translation update
Milo Casagrande [Sat, 7 Jun 2014 15:17:20 +0000 (17:17 +0200)] 
Italian program translation update

Closes: 750009
10 years agocmdline/apt-helper.cc: use less generic description/short-description
Michael Vogt [Fri, 6 Jun 2014 09:24:44 +0000 (11:24 +0200)] 
cmdline/apt-helper.cc: use less generic description/short-description

10 years agoAdd compat mode for old (32bit FileSize) CacheDB (LP: #1274466)
Michael Vogt [Wed, 4 Jun 2014 10:39:36 +0000 (12:39 +0200)] 
Add compat mode for old (32bit FileSize) CacheDB (LP: #1274466)

10 years agoShow unauthenticated warning for source packages as well
Michael Vogt [Fri, 30 May 2014 12:47:56 +0000 (14:47 +0200)] 
Show unauthenticated warning for source packages as well

This will show the same unauthenticated warning for source packages
as for binary packages and will not download a source package if
it is unauthenticated. This can be overridden with
--allow-unauthenticated

Closes: #749795
10 years agouse 'native' instead of 'amd64' as pkg arch
David Kalnischkies [Fri, 30 May 2014 21:15:28 +0000 (23:15 +0200)] 
use 'native' instead of 'amd64' as pkg arch

Git-Dch: Ignore

10 years agoupdate symbols files
David Kalnischkies [Fri, 30 May 2014 21:10:30 +0000 (23:10 +0200)] 
update symbols files

Git-Dch: ignore

10 years agoshow current/total testcase statistic also in concise mode
David Kalnischkies [Fri, 30 May 2014 17:18:25 +0000 (19:18 +0200)] 
show current/total testcase statistic also in concise mode

Git-Dch: Ignore

10 years agosupport parsing EDSP requests Architecture{,s} stanza
David Kalnischkies [Fri, 30 May 2014 16:01:47 +0000 (18:01 +0200)] 
support parsing EDSP requests Architecture{,s} stanza

Adds also a small testcase for EDSP

Git-Dch: Ignore

10 years agowithout a filename we can't stat pipes
David Kalnischkies [Fri, 30 May 2014 15:14:13 +0000 (17:14 +0200)] 
without a filename we can't stat pipes

EDSP code uses pipes opened via an FD as sources and later for those
files modification times and filesize are read - but never really used
again. The result we get from FileFd is probably wrong, but as we don't
use it anyway, we just don't fallback if we have nothing to fallback to

Git-Dch: Ignore

10 years agoprint error stack on failure of 'apt' solver
David Kalnischkies [Fri, 30 May 2014 14:52:19 +0000 (16:52 +0200)] 
print error stack on failure of 'apt' solver

Git-Dch: ignore

10 years agocheck exit status of external solvers
David Kalnischkies [Fri, 30 May 2014 13:58:30 +0000 (15:58 +0200)] 
check exit status of external solvers

Solvers are supposed to exit successfully even if they haven't found a
solution, but a solver which fails drastically (like e.g. segfaults)
should be detected and dealt with accordingly instead of ignored.

10 years agoif Resolver fails, do not continue even if not broken
David Kalnischkies [Fri, 30 May 2014 11:42:36 +0000 (13:42 +0200)] 
if Resolver fails, do not continue even if not broken

This can happen if the request is already a well-formed request all by
itself (e.g. the package has no dependencies), but the resolver found
a reason to not accept it as solution. Our edsp 'dump' solver e.g.
shouldn't be able to trigger install, which it does otherwise.

10 years agoMerge EDSP 0.5 w/ multi-arch support for external solvers
David Kalnischkies [Fri, 30 May 2014 11:13:03 +0000 (13:13 +0200)] 
Merge EDSP 0.5 w/ multi-arch support for external solvers

"I am going to merge it tomorrow…"

10 years agoMerge remote-tracking branch 'mvo/debian/sid' into debian/sid
Michael Vogt [Thu, 29 May 2014 10:23:51 +0000 (12:23 +0200)] 
Merge remote-tracking branch 'mvo/debian/sid' into debian/sid

10 years agoFix more warnings from clang
Michael Vogt [Wed, 28 May 2014 08:29:23 +0000 (10:29 +0200)] 
Fix more warnings from clang

Reported-By: clang++ -Werror
Conflicts:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/deb/debmetaindex.h

10 years agocmdline/apt-extracttemplates.cc: remove unused private var
Michael Vogt [Wed, 28 May 2014 11:49:52 +0000 (13:49 +0200)] 
cmdline/apt-extracttemplates.cc: remove unused private var

Reported-By: clang -Wall
10 years agoMerge remote-tracking branch 'upstream/debian/sid' into debian/experimental
Michael Vogt [Thu, 29 May 2014 10:14:42 +0000 (12:14 +0200)] 
Merge remote-tracking branch 'upstream/debian/sid' into debian/experimental

Conflicts:
test/integration/test-bug-747261-arch-specific-conflicts

10 years ago(try to) fix travis-ci build failures
David Kalnischkies [Mon, 12 May 2014 19:25:43 +0000 (21:25 +0200)] 
(try to) fix travis-ci build failures

dpkg on Ubuntu 12.04 does not seem to support parsing arch-specific
dependencies, so we try to detect if we face such a dpkg in the test.

In the other test the order depends on libdb, which changes per arch, so
we just run it through our sorting binary and be happy (hopefully).

Git-Dch: Ignore

10 years agoincrease Pkg/Grp hash table size from 2k to 64k
Michael Vogt [Thu, 29 May 2014 08:29:21 +0000 (10:29 +0200)] 
increase Pkg/Grp hash table size from 2k to 64k

10 years agoadd hashtable stats
Michael Vogt [Thu, 29 May 2014 08:22:09 +0000 (10:22 +0200)] 
add hashtable stats

10 years agocmdline/apt-extracttemplates.cc: remove unused private var
Michael Vogt [Wed, 28 May 2014 11:49:52 +0000 (13:49 +0200)] 
cmdline/apt-extracttemplates.cc: remove unused private var

Reported-By: clang -Wall
10 years agotest/integration/test-apt-ftparchive-src-cachedb: make test more robust
Michael Vogt [Wed, 28 May 2014 09:22:10 +0000 (11:22 +0200)] 
test/integration/test-apt-ftparchive-src-cachedb: make test more robust

10 years agoFix more warnings from clang
Michael Vogt [Wed, 28 May 2014 08:29:23 +0000 (10:29 +0200)] 
Fix more warnings from clang

Reported-By: clang++ -Werror
10 years agoFix warning about uninitialized variable
Michael Vogt [Wed, 28 May 2014 08:00:52 +0000 (10:00 +0200)] 
Fix warning about uninitialized variable

Reported-By: clang++ -Werror
10 years agoFix uninitialized value
Michael Vogt [Wed, 28 May 2014 07:24:58 +0000 (09:24 +0200)] 
Fix uninitialized value

Reported-By: scan-build
10 years agouse free() instead of delete[] in debSrcRecordParser::~debSrcRecordParser
Michael Vogt [Tue, 27 May 2014 21:42:10 +0000 (23:42 +0200)] 
use free() instead of delete[] in debSrcRecordParser::~debSrcRecordParser

The Buffer was allocated using strndup() so we need to free it using
free() instead of delete[]

10 years agoDo not try to cast a pkgDepCache::Policy to a pkgCache
Michael Vogt [Tue, 27 May 2014 15:49:53 +0000 (17:49 +0200)] 
Do not try to cast a pkgDepCache::Policy to a pkgCache

Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer()

Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
10 years agouse free() instead of delete() when realloc is used
Michael Vogt [Tue, 27 May 2014 14:25:43 +0000 (16:25 +0200)] 
use free() instead of delete() when realloc is used

ContentsExtract::~ContentsExtract() needs to use free() because
Data got allocated via realloc()

Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
10 years agoMerge remote-tracking branch 'upstream/debian/sid' into debian/sid
Michael Vogt [Tue, 27 May 2014 12:09:48 +0000 (14:09 +0200)] 
Merge remote-tracking branch 'upstream/debian/sid' into debian/sid

10 years agoupdate Doxyfile to 1.8.7 to silence deprecation warnings
David Kalnischkies [Thu, 22 May 2014 16:41:52 +0000 (18:41 +0200)] 
update Doxyfile to 1.8.7 to silence deprecation warnings

Git-Dch: ignore

10 years agofix screen width detection for apt/apt-get lists
Sebastian Schmidt [Sat, 17 May 2014 04:57:47 +0000 (06:57 +0200)] 
fix screen width detection for apt/apt-get lists

3163087b moved SigWinch(int) from apt-get.cc to private-output.cc
without moving #include <sys/ioctl.h>, making SigWinch a nop.

Closes: 748430, 747942
10 years agomove ByHash into its own function
Michael Vogt [Thu, 22 May 2014 15:47:22 +0000 (17:47 +0200)] 
move ByHash into its own function

10 years agofix tight loop detection and temporary removes
David Kalnischkies [Sat, 17 May 2014 10:37:13 +0000 (12:37 +0200)] 
fix tight loop detection and temporary removes

As outlined in #748355 apt segfaulted if it encountered a loop between a
package pre-depending on a package conflicting with the previous as it
ended up in an endless loop trying to unpack 'the other package'.

In this specific case as an essential package is involved a lot of force
needs to be applied, but can also be caused by 'normal' tight loops and
highlights a problem in how we handle breaks which we want to avoid.

The fix comes in multiple entangled changes:
1. All Smart* calls are guarded with loop detection. Some already had it,
   some had parts of it, some did it incorrect, and some didn't even try.
2. temporary removes to avoid a loop (which is done if a loop is
   detected) prevent the unpack of this looping package (we tried to unpack
   it to avoid the conflict/breaks, but due to a loop we couldn't, so we
   remove/deconfigure it instead which means we can't unpack it now)
3. handle conflicts and breaks very similar instead of duplicating most
   of the code. The only remaining difference is, as it should:
   deconfigure is enough for breaks, for conflicts we need the big hammer

10 years agoconsistently fail if Smart* packagemanager actions fail
David Kalnischkies [Fri, 16 May 2014 15:28:11 +0000 (17:28 +0200)] 
consistently fail if Smart* packagemanager actions fail

These failure conditions come with an error message attached and the
conditions aren't workaroundable (otherwise this would have been done
instead of returning failure), so not erroring out here means that we
execute dpkg later on with a known not-working ordering adding insult
(our own error messages at the end) to injury (dpkg failure).

10 years agomark as Automatic/Downloadable pure as gcc suggests
David Kalnischkies [Thu, 8 May 2014 17:03:33 +0000 (19:03 +0200)] 
mark as Automatic/Downloadable pure as gcc suggests

Git-Dch: Ignore
Reported-By: gcc
10 years agomake test independent from the actual Install-Size
David Kalnischkies [Thu, 8 May 2014 16:52:51 +0000 (18:52 +0200)] 
make test independent from the actual Install-Size

Git-Dch: Ignore

10 years agoAdd APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to Release file
Michael Vogt [Thu, 22 May 2014 15:36:09 +0000 (17:36 +0200)] 
Add APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to Release file

The by-hash can be configured on a per-hostname basis and a Release
file can indicate that it has by-hash support via a new flag.

The location of the hash now matches the AptByHash spec

10 years agoadd TODO
Michael Vogt [Thu, 22 May 2014 09:09:11 +0000 (11:09 +0200)] 
add TODO

10 years agoImplement simple by-hash for apt update
Michael Vogt [Thu, 22 May 2014 08:49:35 +0000 (10:49 +0200)] 
Implement simple by-hash for apt update

This implements a apt update schema that get the indexfiles by the
hash instead of the name. The rational is that updates to the archive
servers/mirrors are not atomic so the client may have the previous
version of the Release file when the server updates to a new
Release file and new Packages/Sources/Translations indexes. By
keeping the files around by their hash we can still get the previous
indexfile without a hashsum mismatch.

Enable with APT::Acquire::By-Hash=1

10 years agoshow upgradable packages after apt update
Michael Vogt [Tue, 22 Apr 2014 14:07:32 +0000 (16:07 +0200)] 
show upgradable packages after apt update

Closes: 748389
10 years agoadd an additional test for arch specific conflicts
David Kalnischkies [Sat, 10 May 2014 12:21:10 +0000 (14:21 +0200)] 
add an additional test for arch specific conflicts

In bugreport #747261 I confirmed with this testcase that apt actually
supports the requested architecture-specific conflicts already since
2012 with commit cef094c2ec8214b2783a2ac3aa70cf835381eae1.

The old test only does simulations which are handy to check apt,
this one builds 'real' packages to see if dpkg agrees with us.

Git-Dch: Ignore

10 years agoNever parse Version/Architecture tags in a Translation-$lang file
Michael Vogt [Thu, 15 May 2014 12:37:33 +0000 (14:37 +0200)] 
Never parse Version/Architecture tags in a Translation-$lang file

Version/Architecture information in a Translation-$lang file is
not allowed, so don't try to parse it. This is a fix for a bugreport
where a Translation-en file contained the content of the regular
Packages file (probably due to local FS corruption). This lead to
strange error messages on file download.

Thanks to Thomas Reusch for the report.

10 years agoMerge remote-tracking branch 'donkult/debian/experimental' into debian/experimental
Michael Vogt [Wed, 14 May 2014 16:04:48 +0000 (18:04 +0200)] 
Merge remote-tracking branch 'donkult/debian/experimental' into debian/experimental

Conflicts:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h

10 years agoAdd new pkgAcqBaseIndex as base class for pkgAcq{DiffIndex,IndexMerge,pkgAcqBaseIndex...
Michael Vogt [Wed, 14 May 2014 15:47:20 +0000 (17:47 +0200)] 
Add new pkgAcqBaseIndex as base class for pkgAcq{DiffIndex,IndexMerge,pkgAcqBaseIndex, pkgAcqIndex}

10 years agoPass struct IndexTarget/indexRecords to pkgAcqIndex{,Merge}Diffs
Michael Vogt [Wed, 14 May 2014 15:29:23 +0000 (17:29 +0200)] 
Pass struct IndexTarget/indexRecords to pkgAcqIndex{,Merge}Diffs

If one of the pkgAcqIndex{,Merge}Diffs fails, they will run
pkgAcqIndex() which needs the IndexTarget/indexRecords data.
So we pass it along.

10 years ago(try to) fix travis-ci build failures
David Kalnischkies [Mon, 12 May 2014 19:25:43 +0000 (21:25 +0200)] 
(try to) fix travis-ci build failures

dpkg on Ubuntu 12.04 does not seem to support parsing arch-specific
dependencies, so we try to detect if we face such a dpkg in the test.

In the other test the order depends on libdb, which changes per arch, so
we just run it through our sorting binary and be happy (hopefully).

Git-Dch: Ignore

10 years agoadd an additional test for arch specific conflicts
David Kalnischkies [Sat, 10 May 2014 12:21:10 +0000 (14:21 +0200)] 
add an additional test for arch specific conflicts

In bugreport #747261 I confirmed with this testcase that apt actually
supports the requested architecture-specific conflicts already since
2012 with commit cef094c2ec8214b2783a2ac3aa70cf835381eae1.

The old test only does simulations which are handy to check apt,
this one builds 'real' packages to see if dpkg agrees with us.

Git-Dch: Ignore

10 years agoinvalid cache if architecture set doesn't match
David Kalnischkies [Sat, 10 May 2014 10:50:00 +0000 (12:50 +0200)] 
invalid cache if architecture set doesn't match

The cache heavily depends on the architecture(s) it is build for,
especially if you move from single- to multiarch. Adding a new
architecture to dpkg therefore has to be detected and must invalidate
the cache so that we don't operate on incorrect data.

The incorrect data will prevent us from doing otherwise sensible
actions (it doesn't allow bad things to happen) and the recovery is
simple and automatic in most cases, so this hides pretty well and is
also not as serious as it might sound at first.

Closes: 745036
10 years agoimprove pkgTagSection scanning and parsing
David Kalnischkies [Sat, 10 May 2014 09:24:44 +0000 (11:24 +0200)] 
improve pkgTagSection scanning and parsing

Removes the 256 fields limit, deals consistently with spaces littered
all over the place and is even a tiny bit faster than before.
Even comes with a bunch of new tests to validate these claims.

10 years agoparse and retrieve multiple Descriptions in one record
David Kalnischkies [Sun, 18 Aug 2013 20:20:25 +0000 (22:20 +0200)] 
parse and retrieve multiple Descriptions in one record

It seems unlikely for now that proper archives will carry multiple
Description-* stanzas in the Packages (or Translation-*) file, but
sometimes apt eats its own output as shown by the usage of the CD team
and it would be interesting to let apt output multiple translations
e.g. in 'apt-cache show'.

10 years agoreenable pipelining via hashsum reordering support
David Kalnischkies [Mon, 28 Apr 2014 08:02:27 +0000 (10:02 +0200)] 
reenable pipelining via hashsum reordering support

Now that methods have the expected hashes available they can check if
the response from the server is what they expected. Pipelining is one of
those areas in which servers can mess up by not supporting it properly,
which forced us to disable it for the time being. Now, we check if
we got a response out of order, which we can not only use to disable
pipelining automatically for the next requests, but we can fix it up
just like the server responded in proper order for the current requests.

To ensure that this little trick works pipelining is only attempt if we
have hashsums for all the files in the chain which in theory reduces the
use of pipelining usage even on the many servers which work properly,
but in practice only the InRelease file (or similar such) will be
requested without a hashsum – and as it is the only file requested in
that stage it can't be pipelined even if we wanted to.

Some minor annoyances remain: The display of the progress we have
doesn't reflect this change, so it looks like the same package gets
downloaded multiple times while others aren't at all. Further more,
partial files are not supported in this recovery as the received data
was appended to the wrong file, so the hashsum doesn't match.

Both seem to be minor enough to reenable pipelining by default until
further notice through to test if it really solves the problem.
This therefore reverts commit 8221431757c775ee875a061b184b5f6f2330f928.

10 years agotell download methods the expected hashes
David Kalnischkies [Sun, 27 Apr 2014 21:02:00 +0000 (23:02 +0200)] 
tell download methods the expected hashes

Now that we have all hashes in the acquire system, pass the info down to
the methods, so that it can use it in the request and/or to precheck the
response.

10 years agopromote ExpectedHashes to a pkgAcquire::Item member
David Kalnischkies [Sun, 27 Apr 2014 20:25:33 +0000 (22:25 +0200)] 
promote ExpectedHashes to a pkgAcquire::Item member

Beside being another big API break with hopefully zero fallout in
reality it avoids having the same member and helper code in each and
every subclass.

10 years agodeal with hashes in ftparchive more dynamic as well
David Kalnischkies [Sun, 27 Apr 2014 16:23:20 +0000 (18:23 +0200)] 
deal with hashes in ftparchive more dynamic as well

Now that libapts acquire system happily passes around hashes and can be
made to support new ones without an ABI break in the future, we can
free ftparchive from all the deprecation warnings the last commit
introduced for it.

The goal here isn't to preserve ABI as we have none to keep here, but to
help avoiding introduction problems of 'new' hashes later as bugs creep
into the copy&paste parts, so short/less of them is good.

10 years agouse HashStringList in the acquire system
David Kalnischkies [Sun, 18 Aug 2013 22:00:23 +0000 (00:00 +0200)] 
use HashStringList in the acquire system

It is not very extensible to have the supported Hashes hardcoded
everywhere and especially if it is part of virtual method names.
It is also possible that a method does not support the 'best' hash
(yet), so we might end up not being able to verify a file even though we
have a common subset of supported hashes. And those are just two of the
cases in which it is handy to have a more dynamic selection.

The downside is that this is a MAJOR API break, but the HashStringList
has a string constructor for compatibility, so with a bit of luck the
few frontends playing with the acquire system directly are okay.