From 89a1aa5dd55a3469c92720c7fcb90779f90b61f0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2011 21:23:00 +0200 Subject: add a very dumb pause method to stop test-execution --- test/integration/framework | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/framework b/test/integration/framework index cc5af798c..96cdb5f5e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -708,3 +708,9 @@ testmarkedauto() { fi aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } + +pause() { + echo "STOPPED execution. Press enter to continue" + local IGNORE + read IGNORE +} -- cgit v1.2.3 From 2e3c9d6452e69dcb5c83732fbda27b747bc997f4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2011 21:29:16 +0200 Subject: * apt-pkg/indexcopy.cc: - Verify that the first line of an InRelease file is a PGP header for a signed message. Otherwise a man-in-the-middle can prefix a valid InRelease file with his own data! (CVE-2011-1829) --- apt-pkg/indexcopy.cc | 21 ++++++++++++++- debian/changelog | 6 ++++- methods/gpgv.cc | 13 +++++---- ...st-ubuntu-bug-784473-InRelease-one-message-only | 31 ++++++++++++++++++++++ 4 files changed, 64 insertions(+), 7 deletions(-) create mode 100755 test/integration/test-ubuntu-bug-784473-InRelease-one-message-only diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 064fb007c..31c577705 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -664,6 +664,21 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, int const &statusfd, int fd[2]) { + if (File == FileGPG) + { + #define SIGMSG "-----BEGIN PGP SIGNED MESSAGE-----\n" + char buffer[sizeof(SIGMSG)]; + FILE* gpg = fopen(File.c_str(), "r"); + if (gpg == NULL) + return _error->Errno("RunGPGV", _("Could not open file %s"), File.c_str()); + char const * const test = fgets(buffer, sizeof(buffer), gpg); + fclose(gpg); + if (test == NULL || strcmp(buffer, SIGMSG) != 0) + return _error->Error(_("File %s doesn't start with a clearsigned message"), File.c_str()); + #undef SIGMSG + } + + string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); // FIXME: remove support for deprecated APT::GPGV setting string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted")); @@ -688,7 +703,11 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, Args.reserve(30); if (keyrings.empty() == true) - return false; + { + // TRANSLATOR: %s is the trusted keyring parts directory + return _error->Error(_("No keyring installed in %s."), + _config->FindDir("Dir::Etc::TrustedParts").c_str()); + } Args.push_back(gpgvpath.c_str()); Args.push_back("--ignore-time-conflict"); diff --git a/debian/changelog b/debian/changelog index 971cf53b7..c2cf8257e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,10 @@ apt (0.8.14.2) UNRELEASED; urgency=low * Galician translation update (Miguel Anxo Bouzada). Closes: #626505 [ David Kalnischkies ] + * apt-pkg/indexcopy.cc: + - Verify that the first line of an InRelease file is a PGP header + for a signed message. Otherwise a man-in-the-middle can prefix + a valid InRelease file with his own data! (CVE-2011-1829) * fix a bunch of cppcheck warnings/errors based on a patch by Niels Thykier, thanks! (Closes: #622805) * apt-pkg/depcache.cc: @@ -78,7 +82,7 @@ apt (0.8.14.2) UNRELEASED; urgency=low - show Acquire::Languages and APT::Architectures settings in 'dump' (Closes: 626739) - -- David Kalnischkies Sat, 28 May 2011 10:54:23 +0200 + -- David Kalnischkies Mon, 06 Jun 2011 21:24:28 +0200 apt (0.8.14.1) unstable; urgency=low diff --git a/methods/gpgv.cc b/methods/gpgv.cc index efe1f73f7..960c06180 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -65,13 +65,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, return string("Couldn't spawn new process") + strerror(errno); else if (pid == 0) { - if (SigVerify::RunGPGV(outfile, file, 3, fd) == false) + _error->PushToStack(); + bool const success = SigVerify::RunGPGV(outfile, file, 3, fd); + if (success == false) { - // TRANSLATOR: %s is the trusted keyring parts directory - ioprintf(ret, _("No keyring installed in %s."), - _config->FindDir("Dir::Etc::TrustedParts").c_str()); - return ret.str(); + string errmsg; + _error->PopMessage(errmsg); + _error->RevertToStack(); + return errmsg; } + _error->RevertToStack(); exit(111); } close(fd[1]); diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only new file mode 100755 index 000000000..d97011914 --- /dev/null +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'apt' 'i386' '0.8.11' + +setupaptarchive + +rm -rf rootdir/var/lib/apt/lists + +find aptarchive/ -name 'Release.gpg' -delete +find aptarchive/ -name 'InRelease' -exec cp {} {}.old \; + +for RELEASE in $(find aptarchive/ -name 'InRelease'); do + (echo 'Origin: Marvin +Label: Marvin +Suite: experimental +Codename: experimental +MD5Sum: + 65fd410587b6978de2277f2912523f09 9360 Packages + d27b294ed172a1fa9dd5a53949914c5d 4076 Packages.bz2 + 2182897e0a2a0c09e760beaae117a015 2023 Packages.diff/Index + 1b895931853981ad8204d2439821b999 4144 Packages.gz'; echo; cat ${RELEASE}.old;) > ${RELEASE} +done +aptget update -qq > /dev/null 2> starts-with-unsigned.msg +sed -i 's#File .*InRelease#File InRelease#' starts-with-unsigned.msg +testfileequal starts-with-unsigned.msg "W: GPG error: file: unstable InRelease: File InRelease doesn't start with a clearsigned message" -- cgit v1.2.3 From aaa7858c3583617b068bd87af4e17be4d02da0bf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2011 21:33:55 +0200 Subject: revert 2114.1.12 as doxygen does this for use now --- debian/changelog | 4 +--- debian/rules | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2cf8257e..c7b7ea13c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,8 +38,6 @@ apt (0.8.14.2) UNRELEASED; urgency=low - log reinstall commands in history.log * debian/apt{,-utils}.symbols: - update both experimental symbol-files to reflect 0.8.14 state - * debian/rules: - - remove unused embedded jquery by doxygen from libapt-pkg-doc * cmdline/apt-mark.cc: - reimplement apt-mark in c++ - provide a 'showmanual' command (Closes: #582791) @@ -82,7 +80,7 @@ apt (0.8.14.2) UNRELEASED; urgency=low - show Acquire::Languages and APT::Architectures settings in 'dump' (Closes: 626739) - -- David Kalnischkies Mon, 06 Jun 2011 21:24:28 +0200 + -- David Kalnischkies Mon, 06 Jun 2011 21:33:01 +0200 apt (0.8.14.1) unstable; urgency=low diff --git a/debian/rules b/debian/rules index 0544b2b8e..640900678 100755 --- a/debian/rules +++ b/debian/rules @@ -120,9 +120,6 @@ libapt-pkg-doc: build-doc # # libapt-pkg-doc install # - # remove doxygen's embedded jquery as we don't use it anyway (#622147) - rm -f $(BLD)/doc/doxygen/html/jquery.js - dh_installdocs -p$@ $(BLD)/docs/design* \ $(BLD)/docs/dpkg-tech* \ $(BLD)/docs/files* \ -- cgit v1.2.3 From bd0fc582449b86f74be582e3407e09334ba9e71d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 16:38:49 +0200 Subject: * doc/makefile: - create doxygen directory to avoid depending on magic (Closes: #628799) --- debian/changelog | 8 ++++++++ doc/makefile | 1 + 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7598a139d..a2e08558d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.8.15.1) unstable; urgency=low + + [ David Kalnischkies ] + * doc/makefile: + - create doxygen directory to avoid depending on magic (Closes: #628799) + + -- David Kalnischkies Wed, 29 Jun 2011 16:37:58 +0200 + apt (0.8.15) unstable; urgency=low [ Julian Andres Klode ] diff --git a/doc/makefile b/doc/makefile index 8a889c94c..4fcf3bd10 100644 --- a/doc/makefile +++ b/doc/makefile @@ -101,6 +101,7 @@ $(BUILD)/doc/Doxyfile: Doxyfile.in $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile rm -fr $(BUILD)/doc/doxygen + mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 $(DOXYGEN) $(BUILD)/doc/Doxyfile touch $(BUILD)/doc/doxygen-stamp -- cgit v1.2.3 From 49434e94575cfcc14d2f43bdd86c2c5c351d02a8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 17:15:56 +0200 Subject: * cmdline/apt-key: - explicitly state that net-update is not supported if no url is set --- cmdline/apt-key | 4 ++-- debian/changelog | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmdline/apt-key b/cmdline/apt-key index 3838fafcd..86e982054 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -59,13 +59,13 @@ add_keys_with_verify_against_master_keyring() { # (otherwise it does not make sense from a security POV) net_update() { if [ -z "$ARCHIVE_KEYRING_URI" ]; then - echo "ERROR: no location for the archive-keyring given" + echo >&2 "ERROR: Your distribution is not supported in net-update as no uri for the archive-keyring is set" exit 1 fi # in theory we would need to depend on wget for this, but this feature # isn't useable in debian anyway as we have no keyring uri nor a master key if ! which wget >/dev/null 2>&1; then - echo "ERROR: an installed wget is required for a network-based update" + echo >&2 "ERROR: an installed wget is required for a network-based update" exit 1 fi if [ ! -d /var/lib/apt/keyrings ]; then diff --git a/debian/changelog b/debian/changelog index a2e08558d..b28531db7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ apt (0.8.15.1) unstable; urgency=low [ David Kalnischkies ] * doc/makefile: - create doxygen directory to avoid depending on magic (Closes: #628799) + * cmdline/apt-key: + - explicitly state that net-update is not supported if no url is set - -- David Kalnischkies Wed, 29 Jun 2011 16:37:58 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 17:13:26 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From 7851d583df07d81b708f62e130a9132faa495979 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 17:24:47 +0200 Subject: require to be root for add, rm, update and net-update --- cmdline/apt-key | 11 +++++++++++ debian/changelog | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmdline/apt-key b/cmdline/apt-key index 86e982054..843163f82 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -21,6 +21,13 @@ ARCHIVE_KEYRING_URI="" ARCHIVE_KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg REMOVED_KEYS=/usr/share/keyrings/debian-archive-removed-keys.gpg +requires_root() { + if [ "$(id -u)" -ne 0 ]; then + echo >&1 "ERROR: This command can only be used by root." + exit 1 + fi +} + add_keys_with_verify_against_master_keyring() { ADD_KEYRING=$1 MASTER=$2 @@ -62,6 +69,7 @@ net_update() { echo >&2 "ERROR: Your distribution is not supported in net-update as no uri for the archive-keyring is set" exit 1 fi + requires_root # in theory we would need to depend on wget for this, but this feature # isn't useable in debian anyway as we have no keyring uri nor a master key if ! which wget >/dev/null 2>&1; then @@ -93,6 +101,7 @@ update() { echo >&2 "Is the debian-archive-keyring package installed?" exit 1 fi + requires_root # add new keys from the package; @@ -184,10 +193,12 @@ fi case "$command" in add) + requires_root $GPG --quiet --batch --import "$1" echo "OK" ;; del|rm|remove) + requires_root $GPG --quiet --batch --delete-key --yes "$1" echo "OK" ;; diff --git a/debian/changelog b/debian/changelog index b28531db7..51dda4d0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,9 @@ apt (0.8.15.1) unstable; urgency=low - create doxygen directory to avoid depending on magic (Closes: #628799) * cmdline/apt-key: - explicitly state that net-update is not supported if no url is set + - require to be root for add, rm, update and net-update - -- David Kalnischkies Wed, 29 Jun 2011 17:13:26 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 17:24:02 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From f7acb21c7eea6f90f8596add1ec9514e14c1f816 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 18:15:44 +0200 Subject: clarify update vs. net-update in different distros (Closes: #632043) --- debian/changelog | 3 ++- doc/apt-key.8.xml | 21 ++++++++++++--------- doc/apt-verbatim.ent | 6 ++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 51dda4d0c..395fe121d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,9 @@ apt (0.8.15.1) unstable; urgency=low * cmdline/apt-key: - explicitly state that net-update is not supported if no url is set - require to be root for add, rm, update and net-update + - clarify update vs. net-update in different distros (Closes: #632043) - -- David Kalnischkies Wed, 29 Jun 2011 17:24:02 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 18:14:52 +0200 apt (0.8.15) unstable; urgency=low diff --git a/doc/apt-key.8.xml b/doc/apt-key.8.xml index 9bfab84b6..f17f0c45e 100644 --- a/doc/apt-key.8.xml +++ b/doc/apt-key.8.xml @@ -128,9 +128,10 @@ - Update the local keyring with the keyring of Debian archive - keys and removes from the keyring the archive keys which are no - longer valid. + Update the local keyring with the archive keyring and remove from + the local keyring the archive keys which are no longer valid. + The archive keyring is shipped in the archive-keyring package of your + distribution, e.g. the debian-archive-keyring package in Debian. @@ -141,12 +142,14 @@ - Update the local keyring with the keys of a key server - and removes from the keyring the archive keys which are no - longer valid. This requires an installed wget and an APT - build configured to have a server to fetch from. APT in - Debian does not support this command, but Ubuntu's APT - does. + Work similar to the update command above, but get the + archive keyring from an URI instead and validate it against a master key. + + This requires an installed &wget; and an APT build configured to have + a server to fetch from and a master keyring to validate. + + APT in Debian does not support this command and relies on + update instead, but Ubuntu's APT does. diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index a194a9d0d..14cd70e89 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -148,6 +148,12 @@ " > + + wget + 1 + " +> + -- cgit v1.2.3 From 2fdcd6ffa17ffb0eb58ef6d5d97803d18ed9c753 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 18:15:56 +0200 Subject: * debian/apt.symbols: - forgot 'mips' in the list for all architecture dependent symbols --- debian/apt.symbols | 8 ++++---- debian/changelog | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/apt.symbols b/debian/apt.symbols index fb8403839..9d3df3102 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -1246,7 +1246,7 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (arch=alpha|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&, unsigned long&)@Base" 0.8.11.4 1 (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned int&)@Base" 0.8.11.4 1 (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned long&)@Base" 0.8.11.4 1 - (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1 + (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1 (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1 (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1 (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1 @@ -1254,13 +1254,13 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1 (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned int&)@Base" 0.8.11.4 1 (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned long&)@Base" 0.8.11.4 1 - (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 1 + (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 1 (arch=ia64 sparc64|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned long&)@Base" 0.8.11.4 1 (arch=sh4|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&, int, unsigned int&)@Base" 0.8.11.4 1 ### architecture specific: size_t - (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mipsel powerpc powerpcspe sh4 sparc|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0 + (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0 (arch=alpha amd64 ia64 kfreebsd-amd64 s390 sparc64|c++)"_strtabexpand(char*, unsigned long)@Base" 0.8.0 - (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mipsel powerpc powerpcspe sh4 sparc|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&)@Base" 0.8.0 + (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&)@Base" 0.8.0 (arch=alpha amd64 ia64 kfreebsd-amd64 s390 sparc64|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned long&)@Base" 0.8.0 ### try to ignore std:: template instances (c++|regex|optional=std)"^(void |)std::[^ ]+<.+ >::(_|~).+\(.*\)@Base$" 0.8.0 diff --git a/debian/changelog b/debian/changelog index 395fe121d..66d160e60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,10 @@ apt (0.8.15.1) unstable; urgency=low - explicitly state that net-update is not supported if no url is set - require to be root for add, rm, update and net-update - clarify update vs. net-update in different distros (Closes: #632043) + * debian/apt.symbols: + - forgot 'mips' in the list for all architecture dependent symbols - -- David Kalnischkies Wed, 29 Jun 2011 18:14:52 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 18:15:49 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From c77b3b37b8d18c9ecc965d18d82636e563412762 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 18:46:01 +0200 Subject: comment out gcc-4.5 specific symbols as gcc-4.6 is now default --- debian/apt.symbols | 12 ++++++------ debian/changelog | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/debian/apt.symbols b/debian/apt.symbols index 9d3df3102..5a94e2b11 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -1230,16 +1230,16 @@ libapt-pkg.so.4.10 libapt-pkg4.10 # (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 # (c++|regex|optional=std)"^pkgCache::(Dep|Pkg|Ver|Grp|Prv|Desc|PkgFile)Iterator\*\* std::_.+@Base$" 0.8.0 ### gcc-4.5 specific - (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 - (c++|optional=inline)"FileFd::FileFd(std::basic_string, std::allocator >, FileFd::OpenMode, unsigned long)@Base" 0.8.0 - (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0 - (c++|optional=template)"SPtrArray::~SPtrArray()@Base" 0.8.0 +# (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0 +# (c++|optional=inline)"FileFd::FileFd(std::basic_string, std::allocator >, FileFd::OpenMode, unsigned long)@Base" 0.8.0 +# (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0 +# (c++|optional=template)"SPtrArray::~SPtrArray()@Base" 0.8.0 ### gcc-4.6 specific (c++|optional=template)"SPtrArray::~SPtrArray()@Base" 0.8.0 (c++|regex|optional=std)"^std::basic_string, std::allocator >::basic_string\(.+\)@Base$" 0.8.0 (c++|regex|optional=std)"^std::vector::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 - (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0 +# (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0 ### architecture specific: va_list & size_t (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@Base" 0.8.11.4 1 (arch=armel armhf|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@Base" 0.8.11.4 1 @@ -1249,6 +1249,7 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1 (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1 (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1 + (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1 (arch=armel armhf|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 1 (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1 @@ -1319,5 +1320,4 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++|optional=private)"PrintMode(char)@Base" 0.8.13.2 1 (c++)"pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList, pkgCache::PkgIterator const&, unsigned long, bool)@Base" 0.8.13.2 1 (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator, bool)@Base" 0.8.15~exp1 1 - (c++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@Base" 0.8.15~exp1 1 (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1 1 diff --git a/debian/changelog b/debian/changelog index 66d160e60..527902820 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ apt (0.8.15.1) unstable; urgency=low - clarify update vs. net-update in different distros (Closes: #632043) * debian/apt.symbols: - forgot 'mips' in the list for all architecture dependent symbols + - comment out gcc-4.5 specific symbols as gcc-4.6 is now default - -- David Kalnischkies Wed, 29 Jun 2011 18:15:49 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 18:45:39 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From 9919af907aef04caa4061e411259525e46eb49e2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 18:46:20 +0200 Subject: the symbol for PrintStatus() is architecture dependent --- debian/apt.symbols | 7 +++++++ debian/changelog | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/apt.symbols b/debian/apt.symbols index 5a94e2b11..04e13edd7 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -1240,6 +1240,13 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++|regex|optional=std)"^std::vector::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 # (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0 +### architecture specific: va_list + (arch=armel armhf|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, std::__va_list&) const@Base" 0.8.15~exp1 1 + (arch=i386 hurd-i386 kfreebsd-i386|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@Base" 0.8.15~exp1 1 + (arch=hppa ia64 mips mipsel sparc sparc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, void*&) const@Base" 0.8.15~exp1 1 + (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag (&) [1]) const@Base" 0.8.15~exp1 1 + (arch=sh4|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __builtin_va_list&) const@Base" 0.8.15~exp1 1 + (arch=alpha|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag&) const@Base" 0.8.15~exp1 1 ### architecture specific: va_list & size_t (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@Base" 0.8.11.4 1 (arch=armel armhf|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@Base" 0.8.11.4 1 diff --git a/debian/changelog b/debian/changelog index 527902820..5c21cc4e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,9 @@ apt (0.8.15.1) unstable; urgency=low * debian/apt.symbols: - forgot 'mips' in the list for all architecture dependent symbols - comment out gcc-4.5 specific symbols as gcc-4.6 is now default + - the symbol for PrintStatus() is architecture dependent - -- David Kalnischkies Wed, 29 Jun 2011 18:45:39 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 18:46:06 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From 5b7d1ee67575e311871fb73be421ea7fd2f6fd73 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 22:38:59 +0200 Subject: * apt-pkg/policy.cc: - do not segfault in pinning if a package with this name doesn't exist. Thanks to Ferdinand Thommes for the report! --- apt-pkg/policy.cc | 3 ++ debian/changelog | 5 ++- test/integration/test-pin-non-existent-package | 44 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 test/integration/test-pin-non-existent-package diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 2cc2e5e39..291d83c67 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -231,6 +231,9 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, // Get a spot to put the pin pkgCache::GrpIterator Grp = Cache->FindGrp(Name); + if (Grp.end() == true) + return; + for (pkgCache::PkgIterator Pkg = Grp.PackageList(); Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) { diff --git a/debian/changelog b/debian/changelog index 5c21cc4e5..e527142c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,11 @@ apt (0.8.15.1) unstable; urgency=low - forgot 'mips' in the list for all architecture dependent symbols - comment out gcc-4.5 specific symbols as gcc-4.6 is now default - the symbol for PrintStatus() is architecture dependent + * apt-pkg/policy.cc: + - do not segfault in pinning if a package with this name doesn't exist. + Thanks to Ferdinand Thommes for the report! - -- David Kalnischkies Wed, 29 Jun 2011 18:46:06 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 22:05:50 +0200 apt (0.8.15) unstable; urgency=low diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package new file mode 100755 index 000000000..1031272e2 --- /dev/null +++ b/test/integration/test-pin-non-existent-package @@ -0,0 +1,44 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'apt' 'i386' '0.8.15' + +setupaptarchive + +testcandidate() { + msgtest "Test that the Candidate for $1 is" $2 + test "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" && msgpass || msgfail +} + +testcandidate apt '0.8.15' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo 'Package: apt +Pin: release a=unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences + +testcandidate apt '(none)' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo ' +Package: doesntexist +Pin: release a=unstable +Pin-Priority: 1000' >> rootdir/etc/apt/preferences + +testcandidate apt '(none)' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 + +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -- cgit v1.2.3 From 1925ea3d0cd6579a4034acb7308e532d025319c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 23:16:00 +0200 Subject: Defaults is a vector of Pin not of PkgPin --- apt-pkg/policy.cc | 2 +- debian/changelog | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 291d83c67..827c9145c 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -210,7 +210,7 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, { if (Name.empty() == true) { - Pin *P = &*Defaults.insert(Defaults.end(),PkgPin()); + Pin *P = &*Defaults.insert(Defaults.end(),Pin()); P->Type = Type; P->Priority = Priority; P->Data = Data; diff --git a/debian/changelog b/debian/changelog index e527142c4..c4f7af623 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,8 +14,9 @@ apt (0.8.15.1) unstable; urgency=low * apt-pkg/policy.cc: - do not segfault in pinning if a package with this name doesn't exist. Thanks to Ferdinand Thommes for the report! + - Defaults is a vector of Pin not of PkgPin - -- David Kalnischkies Wed, 29 Jun 2011 22:05:50 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 23:15:35 +0200 apt (0.8.15) unstable; urgency=low -- cgit v1.2.3 From e2bba11c9a1858c98954e7c5299d20a6c0966cc7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 23:26:38 +0200 Subject: - ensure that only the first specific stanza for a package is used - save all stanzas which had no effect in Unmatched --- apt-pkg/policy.cc | 27 ++++++++++++-------------- apt-pkg/policy.h | 1 + debian/changelog | 4 +++- test/integration/test-pin-non-existent-package | 15 +++++++++++++- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 827c9145c..78f44d635 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -229,28 +229,25 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, return; } - // Get a spot to put the pin + // find the package group this pin applies to pkgCache::GrpIterator Grp = Cache->FindGrp(Name); if (Grp.end() == true) + { + Pin *P = &*Unmatched.insert(Unmatched.end(),PkgPin(Name)); + P->Type = Type; + P->Priority = Priority; + P->Data = Data; return; + } for (pkgCache::PkgIterator Pkg = Grp.PackageList(); Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) { - Pin *P = 0; - if (Pkg.end() == false) - P = Pins + Pkg->ID; - else - { - // Check the unmatched table - for (vector::iterator I = Unmatched.begin(); - I != Unmatched.end() && P == 0; I++) - if (I->Pkg == Name) - P = &*I; - - if (P == 0) - P = &*Unmatched.insert(Unmatched.end(),PkgPin()); - } + Pin *P = Pins + Pkg->ID; + // the first specific stanza for a package is the ruler, + // all others need to be ignored + if (P->Type != pkgVersionMatch::None) + P = &*Unmatched.insert(Unmatched.end(),PkgPin(Pkg.FullName())); P->Type = Type; P->Priority = Priority; P->Data = Data; diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index f8b2678de..a5e6c6048 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -55,6 +55,7 @@ class pkgPolicy : public pkgDepCache::Policy struct PkgPin : Pin { string Pkg; + PkgPin(string const &Pkg) : Pin(), Pkg(Pkg) {}; }; Pin *Pins; diff --git a/debian/changelog b/debian/changelog index c4f7af623..77b448e77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,10 @@ apt (0.8.15.1) unstable; urgency=low - do not segfault in pinning if a package with this name doesn't exist. Thanks to Ferdinand Thommes for the report! - Defaults is a vector of Pin not of PkgPin + - ensure that only the first specific stanza for a package is used + - save all stanzas which had no effect in Unmatched - -- David Kalnischkies Wed, 29 Jun 2011 23:15:35 +0200 + -- David Kalnischkies Wed, 29 Jun 2011 23:21:12 +0200 apt (0.8.15) unstable; urgency=low diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package index 1031272e2..bd6ccc476 100755 --- a/test/integration/test-pin-non-existent-package +++ b/test/integration/test-pin-non-existent-package @@ -12,7 +12,13 @@ setupaptarchive testcandidate() { msgtest "Test that the Candidate for $1 is" $2 - test "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" && msgpass || msgfail + if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then + msgpass + else + echo + aptcache policy $1 + msgfail + fi } testcandidate apt '0.8.15' @@ -36,6 +42,13 @@ Package: doesntexist Pin: release a=unstable Pin-Priority: 1000' >> rootdir/etc/apt/preferences +testcandidate apt '(none)' + +echo ' +Package: apt +Pin: release a=unstable +Pin-Priority: 1000' >> rootdir/etc/apt/preferences + testcandidate apt '(none)' testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 -- cgit v1.2.3 From 9164e147eb78de6b4f8c8ce4b71e93ad71a44725 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Jun 2011 00:03:26 +0200 Subject: allow package:architecure in Package: --- apt-pkg/policy.cc | 40 ++++++++++++++++++++------ debian/changelog | 3 +- test/integration/test-pin-non-existent-package | 15 ++++++++++ 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 78f44d635..bd213e0ce 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -216,7 +216,14 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Data = Data; return; } - + + size_t found = Name.rfind(':'); + string Arch; + if (found != string::npos) { + Arch = Name.substr(found+1); + Name.erase(found); + } + // Allow pinning by wildcards // TODO: Maybe we should always prefer specific pins over non- // specific ones. @@ -225,23 +232,38 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, pkgVersionMatch match(Data, Type); for (pkgCache::GrpIterator G = Cache->GrpBegin(); G.end() != true; ++G) if (match.ExpressionMatches(Name, G.Name())) - CreatePin(Type, G.Name(), Data, Priority); + { + if (Arch.empty() == false) + CreatePin(Type, string(G.Name()).append(":").append(Arch), Data, Priority); + else + CreatePin(Type, G.Name(), Data, Priority); + } return; } - // find the package group this pin applies to - pkgCache::GrpIterator Grp = Cache->FindGrp(Name); - if (Grp.end() == true) + // find the package (group) this pin applies to + pkgCache::GrpIterator Grp; + pkgCache::PkgIterator Pkg; + if (Arch.empty() == false) + Pkg = Cache->FindPkg(Name, Arch); + else { + Grp = Cache->FindGrp(Name); + if (Grp.end() == false) + Pkg = Grp.PackageList(); + } + + if (Pkg.end() == true) { - Pin *P = &*Unmatched.insert(Unmatched.end(),PkgPin(Name)); + PkgPin *P = &*Unmatched.insert(Unmatched.end(),PkgPin(Name)); + if (Arch.empty() == false) + P->Pkg.append(":").append(Arch); P->Type = Type; P->Priority = Priority; P->Data = Data; return; } - for (pkgCache::PkgIterator Pkg = Grp.PackageList(); - Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) + for (; Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) { Pin *P = Pins + Pkg->ID; // the first specific stanza for a package is the ruler, @@ -251,6 +273,8 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Type = Type; P->Priority = Priority; P->Data = Data; + if (Grp.end() == true) + break; } } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 77b448e77..03a314679 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,9 @@ apt (0.8.15.1) unstable; urgency=low - Defaults is a vector of Pin not of PkgPin - ensure that only the first specific stanza for a package is used - save all stanzas which had no effect in Unmatched + - allow package:architecure in Package: - -- David Kalnischkies Wed, 29 Jun 2011 23:21:12 +0200 + -- David Kalnischkies Thu, 30 Jun 2011 00:02:15 +0200 apt (0.8.15) unstable; urgency=low diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package index bd6ccc476..c91e77844 100755 --- a/test/integration/test-pin-non-existent-package +++ b/test/integration/test-pin-non-existent-package @@ -7,6 +7,7 @@ setupenvironment configarchitecture "i386" insertpackage 'unstable' 'apt' 'i386' '0.8.15' +insertpackage 'unstable' 'arch' 'i386' '1.0' setupaptarchive @@ -55,3 +56,17 @@ testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist testequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo 'Package: arch:amd64 +Pin: release a=unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences + +testcandidate arch '1.0' + +echo ' +Package: arch:i386 +Pin: release a=unstable +Pin-Priority: -1' >> rootdir/etc/apt/preferences + +testcandidate arch '(none)' + -- cgit v1.2.3 From 41b4dee4acaadda869840f7a94c58fd5b7d42017 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Jun 2011 14:05:03 +0200 Subject: * apt-pkg/pkgcachegen.cc: - fallback to memory if file is not writeable even if access() told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591) --- apt-pkg/pkgcachegen.cc | 22 +++++++++++++++++++--- debian/changelog | 9 +++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 9820fde81..8f9737e26 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1169,16 +1169,32 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress SPtr Map; if (Writeable == true && CacheFile.empty() == false) { + _error->PushToStack(); unlink(CacheFile.c_str()); CacheF = new FileFd(CacheFile,FileFd::WriteAtomic); fchmod(CacheF->Fd(),0644); Map = CreateDynamicMMap(CacheF, MMap::Public); if (_error->PendingError() == true) - return false; - if (Debug == true) + { + delete CacheF.UnGuard(); + delete Map.UnGuard(); + if (Debug == true) + std::clog << "Open filebased MMap FAILED" << std::endl; + Writeable = false; + if (AllowMem == false) + { + _error->MergeWithStack(); + return false; + } + _error->RevertToStack(); + } + else if (Debug == true) + { + _error->MergeWithStack(); std::clog << "Open filebased MMap" << std::endl; + } } - else + if (Writeable == false || CacheFile.empty() == true) { // Just build it in memory.. Map = CreateDynamicMMap(NULL); diff --git a/debian/changelog b/debian/changelog index 87d25e78f..d74baf2cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +apt (0.8.15.2) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/pkgcachegen.cc: + - fallback to memory if file is not writeable even if access() + told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591) + + -- David Kalnischkies Thu, 30 Jun 2011 14:00:54 +0200 + apt (0.8.15.1) unstable; urgency=low [ David Kalnischkies ] -- cgit v1.2.3 From 8a7a566b0315425c2b393751f0f9b21de0b26b1a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Jun 2011 14:24:59 +0200 Subject: remove empty line dpkg-gensymbols complains about --- debian/apt.symbols | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/apt.symbols b/debian/apt.symbols index 04e13edd7..932fb1411 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -1256,7 +1256,6 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1 (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1 (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1 - (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1 (arch=armel armhf|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 1 (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1 -- cgit v1.2.3 From 64aadc2d005d601074c1599ee51cee08745cfa36 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 5 Jul 2011 15:14:25 +0200 Subject: * doc/sources.list.5.xml: - document available [options] for sources.list entries (Closes: 632441) --- debian/changelog | 4 +++- doc/sources.list.5.xml | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d74baf2cc..dc0f08333 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ apt (0.8.15.2) unstable; urgency=low * apt-pkg/pkgcachegen.cc: - fallback to memory if file is not writeable even if access() told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591) + * doc/sources.list.5.xml: + - document available [options] for sources.list entries (Closes: 632441) - -- David Kalnischkies Thu, 30 Jun 2011 14:00:54 +0200 + -- David Kalnischkies Tue, 05 Jul 2011 15:12:21 +0200 apt (0.8.15.1) unstable; urgency=low diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 837f07683..fab125b4e 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -78,7 +78,7 @@ The format for a sources.list entry using the deb and deb-src types is: - deb uri distribution [component1] [component2] [...] + deb [ options ] uri distribution [component1] [component2] [...] The URI for the deb type must specify the base of the Debian distribution, from which APT will find the information it needs. @@ -109,6 +109,17 @@ simultaneous anonymous users. APT also parallelizes connections to different hosts to more effectively deal with sites with low bandwidth. + options is always optional and needs to be surounded by + square brackets. It can consist of multiple settings in the form + setting=value. + Multiple settings are separated by spaces. The following settings are supported by APT, + note through that unsupported settings will be ignored silently: + arch=arch1,arch2,… + can be used to specify for which architectures packages information should + be downloaded. If this option is not set all architectures defined by the + APT::Architectures option will be downloaded. + + It is important to list sources in order of preference, with the most preferred source listed first. Typically this will result in sorting by speed from fastest to slowest (CD-ROM followed by hosts on a local @@ -206,6 +217,11 @@ deb http://security.debian.org/ &stable-codename;/updates main contrib non-free Source line for the above deb-src file:/home/jason/debian unstable main contrib non-free + The first line gets package information for the architectures in APT::Architectures + while the second always retrieves amd64 and armel. + deb http://ftp.debian.org/debian &stable-codename; main +deb [ arch=amd64,armel ] http://ftp.debian.org/debian &stable-codename; main + Uses HTTP to access the archive at archive.debian.org, and uses only the hamm/main area. deb http://archive.debian.org/debian-archive hamm main -- cgit v1.2.3 From 58014adc6df1772567e0bc32687f1a03cfcb49fb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 5 Jul 2011 15:34:43 +0200 Subject: * doc/apt.conf.5.xml: - document APT::Architectures list (Closes: #612102) --- debian/changelog | 4 +++- doc/apt.conf.5.xml | 10 +++++++++- doc/examples/configure-index | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc0f08333..af7e792db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,10 @@ apt (0.8.15.2) unstable; urgency=low told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591) * doc/sources.list.5.xml: - document available [options] for sources.list entries (Closes: 632441) + * doc/apt.conf.5.xml: + - document APT::Architectures list (Closes: #612102) - -- David Kalnischkies Tue, 05 Jul 2011 15:12:21 +0200 + -- David Kalnischkies Tue, 05 Jul 2011 15:31:55 +0200 apt (0.8.15.1) unstable; urgency=low diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 02de89f3b..2634c47a9 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -153,7 +153,15 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; parsing package lists. The internal default is the architecture apt was compiled for. - + + Architectures + All Architectures the system supports. Processors implementing the amd64 + are e.g. also able to execute binaries compiled for i386; This list is use when fetching files and + parsing package lists. The internal default is always the native architecture (APT::Architecture) + and all foreign architectures it can retrieve by calling dpkg --print-foreign-architectures. + + + Default-Release Default release to install packages from if more than one version available. Contains release name, codename or release version. Examples: 'stable', 'testing', diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 6884e06e3..27232d40b 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -23,6 +23,7 @@ quiet::NoUpdate "true"; // never update progress information - included in -q=1 APT { Architecture "i386"; + Architectures { "amd64"; "armel"; }; Build-Essential "build-essential"; NeverAutoRemove { "linux-image.*"; }; // packages that should never -- cgit v1.2.3 From b41929c0139d0658046fb4e4088a8de167705a99 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 6 Jul 2011 12:46:29 +0200 Subject: * cmdline/apt-get.cc: - restore all important dependencies for garbage packages (LP: #806274) --- cmdline/apt-get.cc | 6 +- debian/changelog | 4 +- .../test-ubuntu-bug-806274-install-suggests | 81 ++++++++++++++++++++++ 3 files changed, 87 insertions(+), 4 deletions(-) create mode 100755 test/integration/test-ubuntu-bug-806274-install-suggests diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 845c92026..3292ae745 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1697,7 +1697,7 @@ bool DoAutomaticRemove(CacheFile &Cache) // we could have removed a new dependency of a garbage package, // so check if a reverse depends is broken and if so install it again. - if (tooMuch.empty() == false && Cache->BrokenCount() != 0) + if (tooMuch.empty() == false && (Cache->BrokenCount() != 0 || Cache->PolicyBrokenCount() != 0)) { bool Changed; do { @@ -1708,8 +1708,8 @@ bool DoAutomaticRemove(CacheFile &Cache) for (pkgCache::DepIterator R = P.RevDependsList(); R.end() == false; ++R) { - if (R->Type != pkgCache::Dep::Depends && - R->Type != pkgCache::Dep::PreDepends) + if (R.IsNegative() == true || + Cache->IsImportantDep(R) == false) continue; pkgCache::PkgIterator N = R.ParentPkg(); if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false)) diff --git a/debian/changelog b/debian/changelog index af7e792db..4b70eec55 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,10 @@ apt (0.8.15.2) unstable; urgency=low - document available [options] for sources.list entries (Closes: 632441) * doc/apt.conf.5.xml: - document APT::Architectures list (Closes: #612102) + * cmdline/apt-get.cc: + - restore all important dependencies for garbage packages (LP: #806274) - -- David Kalnischkies Tue, 05 Jul 2011 15:31:55 +0200 + -- David Kalnischkies Wed, 06 Jul 2011 12:44:58 +0200 apt (0.8.15.1) unstable; urgency=low diff --git a/test/integration/test-ubuntu-bug-806274-install-suggests b/test/integration/test-ubuntu-bug-806274-install-suggests new file mode 100755 index 000000000..fb72f0999 --- /dev/null +++ b/test/integration/test-ubuntu-bug-806274-install-suggests @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'apt' 'i386' '0.8.15' 'Depends: foo +Recommends: bar +Suggests: baz' +insertpackage 'unstable' 'foo' 'i386' '1.0' +insertpackage 'unstable' 'bar' 'i386' '1.0' +insertpackage 'unstable' 'baz' 'i386' '1.0' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar foo +Suggested packages: + baz +The following NEW packages will be installed: + apt bar foo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst bar (1.0 unstable [i386]) +Conf bar (1.0 unstable [i386])' aptget install apt -s --install-recommends --no-install-suggests + + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar baz foo +The following NEW packages will be installed: + apt bar baz foo +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst bar (1.0 unstable [i386]) +Inst baz (1.0 unstable [i386]) +Conf bar (1.0 unstable [i386]) +Conf baz (1.0 unstable [i386])' aptget install apt -s --install-recommends --install-suggests + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +Suggested packages: + baz +Recommended packages: + bar +The following NEW packages will be installed: + apt foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386])' aptget install apt -s --no-install-recommends --no-install-suggests + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + baz foo +Recommended packages: + bar +The following NEW packages will be installed: + apt baz foo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst baz (1.0 unstable [i386]) +Conf baz (1.0 unstable [i386])' aptget install apt -s --no-install-recommends --install-suggests -- cgit v1.2.3 From 78485ab210b815c21ce55cb0cecb834ba5158e18 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 6 Jul 2011 13:41:18 +0200 Subject: * apt-pkg/init.cc: - use CndSet in pkgInitConfig (Closes: #629617) --- apt-pkg/contrib/configuration.cc | 15 +++++++- apt-pkg/contrib/configuration.h | 3 +- apt-pkg/init.cc | 76 +++++++++++++++++++++------------------- debian/changelog | 4 ++- 4 files changed, 59 insertions(+), 39 deletions(-) diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index cc7093fe2..0664e3704 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -318,6 +318,19 @@ void Configuration::CndSet(const char *Name,const string &Value) Itm->Value = Value; } /*}}}*/ +// Configuration::Set - Set an integer value /*{{{*/ +// --------------------------------------------------------------------- +/* */ +void Configuration::CndSet(const char *Name,int const Value) +{ + Item *Itm = Lookup(Name,true); + if (Itm == 0 || Itm->Value.empty() == false) + return; + char S[300]; + snprintf(S,sizeof(S),"%i",Value); + Itm->Value = S; +} + /*}}}*/ // Configuration::Set - Set a value /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -332,7 +345,7 @@ void Configuration::Set(const char *Name,const string &Value) // Configuration::Set - Set an integer value /*{{{*/ // --------------------------------------------------------------------- /* */ -void Configuration::Set(const char *Name,int const &Value) +void Configuration::Set(const char *Name,int const Value) { Item *Itm = Lookup(Name,true); if (Itm == 0) diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 71e5a0e47..3568ce815 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -82,8 +82,9 @@ class Configuration inline void Set(const string &Name,const string &Value) {Set(Name.c_str(),Value);}; void CndSet(const char *Name,const string &Value); + void CndSet(const char *Name,const int Value); void Set(const char *Name,const string &Value); - void Set(const char *Name,const int &Value); + void Set(const char *Name,const int Value); inline bool Exists(const string &Name) const {return Exists(Name.c_str());}; bool Exists(const char *Name) const; diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 31b2d9ccd..38a0814e5 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -33,60 +33,64 @@ const char *pkgLibVersion = Stringfy(APT_PKG_MAJOR) "." bool pkgInitConfig(Configuration &Cnf) { // General APT things - Cnf.Set("APT::Architecture", COMMON_ARCH); - Cnf.Set("APT::Build-Essential::", "build-essential"); - Cnf.Set("APT::Install-Recommends", true); - Cnf.Set("APT::Install-Suggests", false); - Cnf.Set("Dir","/"); + Cnf.CndSet("APT::Architecture", COMMON_ARCH); + if (Cnf.Exists("APT::Build-Essential") == false) + Cnf.Set("APT::Build-Essential::", "build-essential"); + Cnf.CndSet("APT::Install-Recommends", true); + Cnf.CndSet("APT::Install-Suggests", false); + Cnf.CndSet("Dir","/"); // State - Cnf.Set("Dir::State","var/lib/apt/"); + Cnf.CndSet("Dir::State","var/lib/apt/"); /* Just in case something goes horribly wrong, we can fall back to the old /var/state paths.. */ struct stat St; if (stat("/var/lib/apt/.",&St) != 0 && stat("/var/state/apt/.",&St) == 0) - Cnf.Set("Dir::State","var/state/apt/"); + Cnf.CndSet("Dir::State","var/state/apt/"); - Cnf.Set("Dir::State::lists","lists/"); - Cnf.Set("Dir::State::cdroms","cdroms.list"); - Cnf.Set("Dir::State::mirrors","mirrors/"); + Cnf.CndSet("Dir::State::lists","lists/"); + Cnf.CndSet("Dir::State::cdroms","cdroms.list"); + Cnf.CndSet("Dir::State::mirrors","mirrors/"); // Cache - Cnf.Set("Dir::Cache","var/cache/apt/"); - Cnf.Set("Dir::Cache::archives","archives/"); - Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin"); - Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin"); + Cnf.CndSet("Dir::Cache","var/cache/apt/"); + Cnf.CndSet("Dir::Cache::archives","archives/"); + Cnf.CndSet("Dir::Cache::srcpkgcache","srcpkgcache.bin"); + Cnf.CndSet("Dir::Cache::pkgcache","pkgcache.bin"); // Configuration - Cnf.Set("Dir::Etc","etc/apt/"); - Cnf.Set("Dir::Etc::sourcelist","sources.list"); - Cnf.Set("Dir::Etc::sourceparts","sources.list.d"); - Cnf.Set("Dir::Etc::vendorlist","vendors.list"); - Cnf.Set("Dir::Etc::vendorparts","vendors.list.d"); - Cnf.Set("Dir::Etc::main","apt.conf"); - Cnf.Set("Dir::Etc::netrc", "auth.conf"); - Cnf.Set("Dir::Etc::parts","apt.conf.d"); - Cnf.Set("Dir::Etc::preferences","preferences"); - Cnf.Set("Dir::Etc::preferencesparts","preferences.d"); - Cnf.Set("Dir::Etc::trusted", "trusted.gpg"); - Cnf.Set("Dir::Etc::trustedparts","trusted.gpg.d"); - Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods"); - Cnf.Set("Dir::Media::MountPath","/media/apt"); + Cnf.CndSet("Dir::Etc","etc/apt/"); + Cnf.CndSet("Dir::Etc::sourcelist","sources.list"); + Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d"); + Cnf.CndSet("Dir::Etc::vendorlist","vendors.list"); + Cnf.CndSet("Dir::Etc::vendorparts","vendors.list.d"); + Cnf.CndSet("Dir::Etc::main","apt.conf"); + Cnf.CndSet("Dir::Etc::netrc", "auth.conf"); + Cnf.CndSet("Dir::Etc::parts","apt.conf.d"); + Cnf.CndSet("Dir::Etc::preferences","preferences"); + Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d"); + Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg"); + Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d"); + Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt/methods"); + Cnf.CndSet("Dir::Media::MountPath","/media/apt"); // State - Cnf.Set("Dir::Log","var/log/apt"); - Cnf.Set("Dir::Log::Terminal","term.log"); - Cnf.Set("Dir::Log::History","history.log"); + Cnf.CndSet("Dir::Log","var/log/apt"); + Cnf.CndSet("Dir::Log::Terminal","term.log"); + Cnf.CndSet("Dir::Log::History","history.log"); - Cnf.Set("Dir::Ignore-Files-Silently::", "~$"); - Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$"); - Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$"); - Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$"); + if (Cnf.Exists("Dir::Ignore-Files-Silently") == false) + { + Cnf.Set("Dir::Ignore-Files-Silently::", "~$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$"); + } // Default cdrom mount point - Cnf.Set("Acquire::cdrom::mount", "/media/cdrom/"); + Cnf.CndSet("Acquire::cdrom::mount", "/media/cdrom/"); bool Res = true; diff --git a/debian/changelog b/debian/changelog index 4b70eec55..8bf5af2d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ apt (0.8.15.2) unstable; urgency=low - document APT::Architectures list (Closes: #612102) * cmdline/apt-get.cc: - restore all important dependencies for garbage packages (LP: #806274) + * apt-pkg/init.cc: + - use CndSet in pkgInitConfig (Closes: #629617) - -- David Kalnischkies Wed, 06 Jul 2011 12:44:58 +0200 + -- David Kalnischkies Wed, 06 Jul 2011 13:29:52 +0200 apt (0.8.15.1) unstable; urgency=low -- cgit v1.2.3 From db4351bee8204c5eb352bb5667d3fbd416685715 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 15 Jul 2011 09:33:36 +0200 Subject: * apt-pkg/depcache.cc: - change default of APT::AutoRemove::SuggestsImportant to true --- apt-pkg/depcache.cc | 2 +- debian/changelog | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index e9fa097aa..eb3f4e598 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1593,7 +1593,7 @@ bool pkgDepCache::MarkFollowsRecommends() bool pkgDepCache::MarkFollowsSuggests() { - return _config->FindB("APT::AutoRemove::SuggestsImportant", false); + return _config->FindB("APT::AutoRemove::SuggestsImportant", true); } // pkgDepCache::MarkRequired - the main mark algorithm /*{{{*/ diff --git a/debian/changelog b/debian/changelog index 52972e43b..2e22e64d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,8 +19,10 @@ apt (0.8.15.3) UNRELEASED; urgency=low - restore all important dependencies for garbage packages (LP: #806274) * apt-pkg/init.cc: - use CndSet in pkgInitConfig (Closes: #629617) + * apt-pkg/depcache.cc: + - change default of APT::AutoRemove::SuggestsImportant to true - -- David Kalnischkies Thu, 14 Jul 2011 21:26:09 +0200 + -- David Kalnischkies Fri, 15 Jul 2011 09:29:37 +0200 apt (0.8.15.2) unstable; urgency=high -- cgit v1.2.3