From 469b02781dfb4517282da4d497c5f7fd0dcb97f4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 5 Jul 2012 08:59:52 +0200 Subject: * apt-pkg/clean.cc: - run autoclean against pkg:arch and not always against pkg:native as this removes valid cache entries (Closes: #679371) --- apt-pkg/clean.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 9c167eaa5..eae419e34 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -81,12 +81,13 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) if (*I != '.') continue; std::string const Arch = DeQuoteString(std::string(Start,I-Start)); - + + // ignore packages of unconfigured architectures if (APT::Configuration::checkArchitecture(Arch) == false) continue; // Lookup the package - pkgCache::PkgIterator P = Cache.FindPkg(Pkg); + pkgCache::PkgIterator P = Cache.FindPkg(Pkg, Arch); if (P.end() != true) { pkgCache::VerIterator V = P.VersionList(); -- cgit v1.2.3-70-g09d2 From cef094c2ec8214b2783a2ac3aa70cf835381eae1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 9 Jul 2012 17:42:25 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - negative dependencies need to apply to all architectures, but those with a specific architecture only apply to this one --- apt-pkg/deb/deblistparser.cc | 3 +- debian/changelog | 3 + .../test-specific-architecture-dependencies | 182 +++++++++++++++++++++ 3 files changed, 187 insertions(+), 1 deletion(-) create mode 100755 test/integration/test-specific-architecture-dependencies (limited to 'apt-pkg') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index e93e51af3..12c6ab4c9 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -635,7 +635,8 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, return _error->Error("Problem parsing dependency %s",Tag); size_t const found = Package.rfind(':'); - if (MultiArchEnabled == true && + // If negative is unspecific it needs to apply on all architectures + if (MultiArchEnabled == true && found == string::npos && (Type == pkgCache::Dep::Conflicts || Type == pkgCache::Dep::DpkgBreaks || Type == pkgCache::Dep::Replaces)) diff --git a/debian/changelog b/debian/changelog index e0692a40e..634b37253 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,9 @@ apt (0.9.7.2) UNRELEASED; urgency=low * apt-pkg/clean.cc: - run autoclean against pkg:arch and not always against pkg:native as this removes valid cache entries (Closes: #679371) + * apt-pkg/deb/deblistparser.cc: + - negative dependencies need to apply to all architectures, + but those with a specific architecture only apply to this one -- David Kalnischkies Sun, 01 Jul 2012 08:20:57 +0200 diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies new file mode 100755 index 000000000..078a84654 --- /dev/null +++ b/test/integration/test-specific-architecture-dependencies @@ -0,0 +1,182 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'libc6' 'amd64,i386' '1' 'Multi-Arch: same' +insertinstalledpackage 'libold' 'amd64,i386' '1' 'Multi-Arch: same' +insertinstalledpackage 'provider' 'amd64' '1' 'Provides: foo' + +insertpackage 'unstable' 'pre-depender' 'all' '1' 'Pre-Depends: libc6:i386' +insertpackage 'unstable' 'depender' 'all' '1' 'Depends: libc6:i386' + +insertpackage 'unstable' 'breaker' 'all' '1' 'Breaks: libold (<< 2)' +insertpackage 'unstable' 'breaker-x32' 'amd64' '1' 'Breaks: libold:i386 (<< 2)' +insertpackage 'unstable' 'breaker-x64' 'i386' '1' 'Breaks: libold:amd64 (<< 2)' +# conflicts with no effect +insertpackage 'unstable' 'oldconflictor' 'all' '1' 'Conflicts: libold (<< 0)' +insertpackage 'unstable' 'oldconflictor-x32' 'amd64' '1' 'Conflicts: libold:i386 (<< 0)' +insertpackage 'unstable' 'oldconflictor-x64' 'i386' '1' 'Conflicts: libold:amd64 (<< 0)' + +insertpackage 'unstable' 'foo-depender' 'i386,amd64' '1' 'Depends: foo' +insertpackage 'unstable' 'foo-foreign-depender' 'i386' '1' 'Depends: foo:amd64' + +insertpackage 'unstable' 'foo-conflictor' 'i386,amd64' '1' 'Conflicts: foo' +insertpackage 'unstable' 'foo-foreign-conflictor' 'i386' '1' 'Conflicts: foo:amd64' +insertpackage 'unstable' 'foo-no-conflictor' 'i386' '1' 'Conflicts: foo:i386' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libc6:i386 +The following NEW packages will be installed: + libc6:i386 pre-depender +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libc6:i386 (1 unstable [i386]) +Conf libc6:i386 (1 unstable [i386]) +Inst pre-depender (1 unstable [all]) +Conf pre-depender (1 unstable [all])' aptget install pre-depender -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libc6:i386 +The following NEW packages will be installed: + depender libc6:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libc6:i386 (1 unstable [i386]) +Inst depender (1 unstable [all]) +Conf libc6:i386 (1 unstable [i386]) +Conf depender (1 unstable [all])' aptget install depender -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + libold libold:i386 +The following NEW packages will be installed: + breaker +0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. +Remv libold [1] +Remv libold:i386 [1] +Inst breaker (1 unstable [all]) +Conf breaker (1 unstable [all])' aptget install breaker -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + libold:i386 +The following NEW packages will be installed: + breaker-x32 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv libold:i386 [1] +Inst breaker-x32 (1 unstable [amd64]) +Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32 -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + libold +The following NEW packages will be installed: + breaker-x64:i386 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv libold [1] +Inst breaker-x64:i386 (1 unstable [i386]) +Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + oldconflictor +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst oldconflictor (1 unstable [all]) +Conf oldconflictor (1 unstable [all])' aptget install oldconflictor -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + oldconflictor-x32 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst oldconflictor-x32 (1 unstable [amd64]) +Conf oldconflictor-x32 (1 unstable [amd64])' aptget install oldconflictor-x32 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + oldconflictor-x64:i386 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst oldconflictor-x64:i386 (1 unstable [i386]) +Conf oldconflictor-x64:i386 (1 unstable [i386])' aptget install oldconflictor-x64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo-depender +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo-depender (1 unstable [amd64]) +Conf foo-depender (1 unstable [amd64])' aptget install foo-depender -s + +testequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + foo-depender:i386 : Depends: foo:i386 but it is not installable +E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo-foreign-depender:i386 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo-foreign-depender:i386 (1 unstable [i386]) +Conf foo-foreign-depender:i386 (1 unstable [i386])' aptget install foo-foreign-depender:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + provider +The following NEW packages will be installed: + foo-conflictor +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv provider [1] +Inst foo-conflictor (1 unstable [amd64]) +Conf foo-conflictor (1 unstable [amd64])' aptget install foo-conflictor -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + provider +The following NEW packages will be installed: + foo-conflictor:i386 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv provider [1] +Inst foo-conflictor:i386 (1 unstable [i386]) +Conf foo-conflictor:i386 (1 unstable [i386])' aptget install foo-conflictor:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + provider +The following NEW packages will be installed: + foo-foreign-conflictor:i386 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv provider [1] +Inst foo-foreign-conflictor:i386 (1 unstable [i386]) +Conf foo-foreign-conflictor:i386 (1 unstable [i386])' aptget install foo-foreign-conflictor:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo-no-conflictor:i386 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo-no-conflictor:i386 (1 unstable [i386]) +Conf foo-no-conflictor:i386 (1 unstable [i386])' aptget install foo-no-conflictor:i386 -s -- cgit v1.2.3-70-g09d2 From 5f20ac7f11ae5718595d6e570474d120d30e36db Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 12 Jul 2012 20:39:59 +0200 Subject: * apt-pkg/cachefilter.cc: - remove architecture-specific arch to tuple expansion-rules as they lead to the same tuples for different architectures (e.g. linux-arm for arm, armel and armhf) while the dpkg-architecture code uses triples which are different (in the first part, which we omit in our tuples), so e.g. build-dep restrictions for armel ended up effecting armhf as well --- apt-pkg/cachefilter.cc | 6 ------ debian/changelog | 6 ++++++ test/integration/test-architecture-specification-parsing | 15 ++++++++++++++- .../test-bug-632221-cross-dependency-satisfaction | 2 +- .../test-cachecontainer-architecture-specification | 3 +++ 5 files changed, 24 insertions(+), 8 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc index 35f95fe22..58cc812bf 100644 --- a/apt-pkg/cachefilter.cc +++ b/apt-pkg/cachefilter.cc @@ -66,12 +66,6 @@ static std::string CompleteArch(std::string const &arch) { complete = complete.substr(1, complete.size()-2); return complete; } - else if (arch == "armel") return "linux-arm"; - else if (arch == "armhf") return "linux-arm"; - else if (arch == "lpia") return "linux-i386"; - else if (arch == "powerpcspe") return "linux-powerpc"; - else if (arch == "uclibc-linux-armel") return "linux-arm"; - else if (arch == "uclinux-armel") return "uclinux-arm"; else if (arch == "any") return "*-*"; else return "linux-" + arch; } diff --git a/debian/changelog b/debian/changelog index 634b37253..54f96909c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,12 @@ apt (0.9.7.2) UNRELEASED; urgency=low * apt-pkg/deb/deblistparser.cc: - negative dependencies need to apply to all architectures, but those with a specific architecture only apply to this one + * apt-pkg/cachefilter.cc: + - remove architecture-specific arch to tuple expansion-rules as they lead + to the same tuples for different architectures (e.g. linux-arm for arm, + armel and armhf) while the dpkg-architecture code uses triples which + are different (in the first part, which we omit in our tuples), so e.g. + build-dep restrictions for armel ended up effecting armhf as well -- David Kalnischkies Sun, 01 Jul 2012 08:20:57 +0200 diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing index 8f365dd55..2741509a7 100755 --- a/test/integration/test-architecture-specification-parsing +++ b/test/integration/test-architecture-specification-parsing @@ -4,7 +4,7 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture 'amd64' +configarchitecture 'amd64' 'armel' buildsimplenativepackage 'pkg-arch-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !amd64] Depends: foo [amd64 !amd64]' @@ -14,6 +14,8 @@ buildsimplenativepackage 'pkg-arch-foo-unrelated-no' 'amd64' '1.0' 'stable' 'Bui Depends: foo [!kfreebsd-any amd64]' buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !kfreebsd-any] Depends: foo [amd64 !kfreebsd-any]' +buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armhf], bar [arm] +Depends: foo [armhf], bar [arm]' buildsimplenativepackage 'foo' 'amd64' '1.0' 'stable' @@ -93,4 +95,15 @@ The following NEW packages will be installed: Inst foo (1.0 stable [amd64]) Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no2 -s +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s +# this is not really testing APT - more that dpkg is in line with us +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + no-depends:armel +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst no-depends:armel (1.0 stable [armel]) +Conf no-depends:armel (1.0 stable [armel])' aptget install no-depends -s diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 208c613a2..7e8a43a86 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -21,7 +21,7 @@ insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign' insertpackage 'unstable' 'arm-stuff' 'armel' '1.0' insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0' -insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-arm] | linux-stuff [ linux-any]' +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-armel] | linux-stuff [ linux-any]' insertsource 'unstable' 'forbidden-none' 'any' '1' 'Build-Depends: amdboot:any' insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any' diff --git a/test/integration/test-cachecontainer-architecture-specification b/test/integration/test-cachecontainer-architecture-specification index 174efb087..55e464a07 100755 --- a/test/integration/test-cachecontainer-architecture-specification +++ b/test/integration/test-cachecontainer-architecture-specification @@ -27,6 +27,9 @@ Inst libsame:armel (1 unstable [armel]) Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:armel testequal 'Reading package lists... Building dependency tree... +E: Unable to locate package libsame' aptget -s install libsame:armhf +testequal 'Reading package lists... +Building dependency tree... The following NEW packages will be installed: libsame 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -- cgit v1.2.3-70-g09d2 From f1d86c0ee906dc7252dc9158c354c42d3ededa2f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 18 Jul 2012 11:46:36 +0200 Subject: * apt-pkg/cacheset.cc: - handle :all and :native correctly as architectures again in the commandline parsing (regression in 0.9.7) --- apt-pkg/cacheset.cc | 2 ++ debian/changelog | 7 ++++- .../test-cachecontainer-architecture-specification | 33 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 784d1f0bf..1fea4f94a 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -193,6 +193,8 @@ bool PackageContainerInterface::FromGroup(PackageContainerInterface * const pci, if (archfound != std::string::npos) { arch = pkg.substr(archfound+1); pkg.erase(archfound); + if (arch == "all" || arch == "native") + arch = _config->Find("APT::Architecture"); } pkgCache::GrpIterator Grp = Cache.GetPkgCache()->FindGrp(pkg); diff --git a/debian/changelog b/debian/changelog index a9ef6a967..33a466b56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,12 @@ apt (0.9.7.3) UNRELEASED; urgency=low [ Program translation updates ] * Czech (Miroslav Kure). Closes: #680758 - -- Christian Perrier Sat, 14 Jul 2012 09:47:02 -0600 + [ David Kalnischkies ] + * apt-pkg/cacheset.cc: + - handle :all and :native correctly as architectures again + in the commandline parsing (regression in 0.9.7) + + -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 apt (0.9.7.2) unstable; urgency=low diff --git a/test/integration/test-cachecontainer-architecture-specification b/test/integration/test-cachecontainer-architecture-specification index 55e464a07..47abfb5b0 100755 --- a/test/integration/test-cachecontainer-architecture-specification +++ b/test/integration/test-cachecontainer-architecture-specification @@ -8,6 +8,7 @@ configarchitecture 'amd64' 'armel' #insertinstalledpackage 'xserver-xorg-core' 'amd64' '2:1.7.6-2ubuntu7.10' insertpackage 'unstable' 'libsame' 'armel,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'foo' 'all' '1' setupaptarchive @@ -88,3 +89,35 @@ Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:linux-* testequal 'Reading package lists... Building dependency tree... E: Unable to locate package libsame' aptget -s install libsame:windows-any + +testequal 'Reading package lists... +Building dependency tree... +E: Unable to locate package foo' aptget -s install foo:armel +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Conf foo (1 unstable [all])' aptget -s install foo +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Conf foo (1 unstable [all])' aptget -s install foo:all +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Conf foo (1 unstable [all])' aptget -s install foo:amd64 +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Conf foo (1 unstable [all])' aptget -s install foo:native -- cgit v1.2.3-70-g09d2 From 275024e9ae6c827ebb664bd1c0c3264bcff343c0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 18 Jul 2012 13:48:46 +0200 Subject: * apt-pkg/packagemanager.cc: - do not segfault if nothing can be configured to statisfy a pre-depends (e.g. in a pre-depends loop) (Closes: #681958) --- apt-pkg/packagemanager.cc | 2 +- debian/changelog | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 46fc499c6..b93bf6ab9 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -643,7 +643,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c } // Look for something that could be configured. - for (DepIterator Cur = Start; Bad == true; ++Cur) + for (DepIterator Cur = Start; Bad == true && Cur.end() == false; ++Cur) { SPtrArray VList = Cur.AllTargets(); for (Version **I = VList; *I != 0; ++I) diff --git a/debian/changelog b/debian/changelog index c33b9d4b2..d3f599e7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ apt (0.9.7.3) UNRELEASED; urgency=low * apt-pkg/cacheset.cc: - handle :all and :native correctly as architectures again in the commandline parsing (regression in 0.9.7) + * apt-pkg/packagemanager.cc: + - do not segfault if nothing can be configured to statisfy + a pre-depends (e.g. in a pre-depends loop) (Closes: #681958) -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 -- cgit v1.2.3-70-g09d2 From 4bd60a02b45241039d4ca7b5cfaa005e552f3d0d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Jul 2012 13:12:25 +0200 Subject: * apt-pkg/contrib/mmap.cc: - refer to APT::Cache-Start in case the growing failed as if -Limit is really the offender it will be noted in a previous error message. --- apt-pkg/contrib/mmap.cc | 2 +- debian/changelog | 3 +++ po/apt-all.pot | 2 +- po/ar.po | 2 +- po/ast.po | 4 ++-- po/bg.po | 4 ++-- po/bs.po | 2 +- po/ca.po | 4 ++-- po/cs.po | 4 ++-- po/cy.po | 2 +- po/da.po | 4 ++-- po/de.po | 4 ++-- po/dz.po | 2 +- po/el.po | 2 +- po/es.po | 4 ++-- po/eu.po | 4 ++-- po/fi.po | 2 +- po/fr.po | 4 ++-- po/gl.po | 4 ++-- po/he.po | 2 +- po/hu.po | 4 ++-- po/it.po | 4 ++-- po/ja.po | 4 ++-- po/km.po | 2 +- po/ko.po | 4 ++-- po/ku.po | 2 +- po/lt.po | 2 +- po/mr.po | 2 +- po/nb.po | 4 ++-- po/ne.po | 2 +- po/nl.po | 4 ++-- po/nn.po | 2 +- po/pl.po | 4 ++-- po/pt.po | 4 ++-- po/pt_BR.po | 2 +- po/ro.po | 2 +- po/ru.po | 4 ++-- po/sk.po | 4 ++-- po/sl.po | 10 +++++----- po/sv.po | 4 ++-- po/th.po | 2 +- po/tl.po | 2 +- po/uk.po | 2 +- po/vi.po | 4 ++-- po/zh_CN.po | 4 ++-- po/zh_TW.po | 4 ++-- 46 files changed, 76 insertions(+), 73 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 593bb063b..f0ab49265 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -328,7 +328,7 @@ unsigned long DynamicMMap::RawAllocate(unsigned long long Size,unsigned long Aln if(!Grow()) { _error->Fatal(_("Dynamic MMap ran out of room. Please increase the size " - "of APT::Cache-Limit. Current value: %lu. (man 5 apt.conf)"), WorkSpace); + "of APT::Cache-Start. Current value: %lu. (man 5 apt.conf)"), WorkSpace); return 0; } } diff --git a/debian/changelog b/debian/changelog index d3f599e7f..ea15159c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ apt (0.9.7.3) UNRELEASED; urgency=low * apt-pkg/packagemanager.cc: - do not segfault if nothing can be configured to statisfy a pre-depends (e.g. in a pre-depends loop) (Closes: #681958) + * apt-pkg/contrib/mmap.cc: + - refer to APT::Cache-Start in case the growing failed as if -Limit is + really the offender it will be noted in a previous error message. -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 diff --git a/po/apt-all.pot b/po/apt-all.pot index 5c64141cf..8048c9a34 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -2041,7 +2041,7 @@ msgstr "" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ar.po b/po/ar.po index 88158d0d1..2c168a4b5 100644 --- a/po/ar.po +++ b/po/ar.po @@ -2071,7 +2071,7 @@ msgstr "فشلت كتابة الملف %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ast.po b/po/ast.po index 070ffb525..6432dcc26 100644 --- a/po/ast.po +++ b/po/ast.po @@ -2280,11 +2280,11 @@ msgstr "Falló al francer el ficheru" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Dynamic MMap escosó l'espaciu. Por favor aumenta'l tamañu de APT::Cache-" -"Limit. El valor actual ye : %lu. (man 5 apt.conf)" +"Start. El valor actual ye : %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/bg.po b/po/bg.po index f967cbc71..2e4851e55 100644 --- a/po/bg.po +++ b/po/bg.po @@ -2317,11 +2317,11 @@ msgstr "Неуспех при отрязване на края на файла" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Недостатъчна памет за MMap. Увеличете стойността на променливата APT::Cache-" -"Limit. Текуща стойност: %lu (man 5 apt.conf)" +"Start. Текуща стойност: %lu (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/bs.po b/po/bs.po index 6a4772811..a92636f49 100644 --- a/po/bs.po +++ b/po/bs.po @@ -2068,7 +2068,7 @@ msgstr "Ne mogu ukloniti %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ca.po b/po/ca.po index 283af2e4f..2581433db 100644 --- a/po/ca.po +++ b/po/ca.po @@ -2316,11 +2316,11 @@ msgstr "No s'ha pogut truncar el fitxer %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "No hi ha espai per al «Dynamic MMap». Incrementeu la mida d'APT::Cache-" -"Limit. Valor actual: %lu. (man 5 apt.conf)" +"Start. Valor actual: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/cs.po b/po/cs.po index 2259e559d..60cc2d62c 100644 --- a/po/cs.po +++ b/po/cs.po @@ -2282,10 +2282,10 @@ msgstr "Nelze zmenšit soubor" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Dynamickému MMapu došlo místo. Zvyšte prosím hodnotu APT::Cache-Limit. " +"Dynamickému MMapu došlo místo. Zvyšte prosím hodnotu APT::Cache-Start. " "Současná hodnota: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/cy.po b/po/cy.po index ec5d59a2b..ecddc2749 100644 --- a/po/cy.po +++ b/po/cy.po @@ -2320,7 +2320,7 @@ msgstr "Methwyd ysgrifennu ffeil %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/da.po b/po/da.po index ebfba1d73..2efc7242b 100644 --- a/po/da.po +++ b/po/da.po @@ -2302,10 +2302,10 @@ msgstr "Kunne ikke afkorte filen" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Dynamisk MMap løb tør for plads. Øg venligst størrelsen på APT::Cache-Limit. " +"Dynamisk MMap løb tør for plads. Øg venligst størrelsen på APT::Cache-Start. " "Aktuel værdi: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/de.po b/po/de.po index cb35a3acd..860a00fe9 100644 --- a/po/de.po +++ b/po/de.po @@ -2364,11 +2364,11 @@ msgstr "Datei konnte nicht eingekürzt werden." #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Nicht genügend Platz für »Dynamic MMap«. Bitte erhöhen Sie den Wert von APT::" -"Cache-Limit. Aktueller Wert: %lu. (Siehe auch man 5 apt.conf.)" +"Cache-Start. Aktueller Wert: %lu. (Siehe auch man 5 apt.conf.)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/dz.po b/po/dz.po index 6f815804c..b43fb305c 100644 --- a/po/dz.po +++ b/po/dz.po @@ -2273,7 +2273,7 @@ msgstr "%s་ཡིག་སྣོད་འདི་འབྲི་ནི་ལ #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/el.po b/po/el.po index 205c43591..3e8dd8dea 100644 --- a/po/el.po +++ b/po/el.po @@ -2294,7 +2294,7 @@ msgstr "Αποτυχία εγγραφής του αρχείου %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/es.po b/po/es.po index 11295cdae..dda8114b6 100644 --- a/po/es.po +++ b/po/es.po @@ -2361,11 +2361,11 @@ msgstr "Falló al truncar el archivo" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "La asignación dinámica MMap no tiene más espacio. Por favor, incrementa el " -"valor de «APT::Cache-Limit». El valor actual es: %lu (man 5 apt.conf)" +"valor de «APT::Cache-Start». El valor actual es: %lu (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/eu.po b/po/eu.po index 3d3a15b46..e3d7623b8 100644 --- a/po/eu.po +++ b/po/eu.po @@ -2270,10 +2270,10 @@ msgstr "Huts fitxategia mozterakoan" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"MMAP dinamikoa memoriaz kanpo. Mesedez handitu APT::Cache-Limit muga. Uneko " +"MMAP dinamikoa memoriaz kanpo. Mesedez handitu APT::Cache-Start muga. Uneko " "balioa: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/fi.po b/po/fi.po index f0f9a97c6..00f3ae327 100644 --- a/po/fi.po +++ b/po/fi.po @@ -2268,7 +2268,7 @@ msgstr "Tiedoston typistäminen ei onnistunut" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/fr.po b/po/fr.po index b20036cbe..90d5890f8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2359,11 +2359,11 @@ msgstr "Échec de la troncature du fichier" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "La zone dynamique d'allocation mémoire (« Dynamic MMap ») n'a plus de place. " -"Vous devriez augmenter la taille de APT::Cache-Limit, dont la valeur " +"Vous devriez augmenter la taille de APT::Cache-Start, dont la valeur " "actuelle est de %lu (voir « man 5 apt.conf »)." #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/gl.po b/po/gl.po index 574e44c5a..1092efb3b 100644 --- a/po/gl.po +++ b/po/gl.po @@ -2305,11 +2305,11 @@ msgstr "Non foi posíbel truncar o ficheiro" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Dynamic MMap executouse fora do lugar. Incremente o tamaño de APT::Cache-" -"Limit. O valor actual é : %lu. (man 5 apt.conf)" +"Start. O valor actual é : %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/he.po b/po/he.po index e05730472..a2e3cba60 100644 --- a/po/he.po +++ b/po/he.po @@ -1927,7 +1927,7 @@ msgstr "" #: apt-pkg/contrib/mmap.cc:234 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/hu.po b/po/hu.po index f25d00c12..171ecad7b 100644 --- a/po/hu.po +++ b/po/hu.po @@ -2308,10 +2308,10 @@ msgstr "A fájl csonkítása meghiúsult" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"A dinamikus MMap helye elfogyott. Növelje az APT::Cache-Limit méretét. A " +"A dinamikus MMap helye elfogyott. Növelje az APT::Cache-Start méretét. A " "jelenlegi érték: %lu. (lásd: man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/it.po b/po/it.po index d616c84a9..d24f1aeb5 100644 --- a/po/it.po +++ b/po/it.po @@ -2336,10 +2336,10 @@ msgstr "Troncamento del file non riuscito" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"MMap dinamica esaurita. Aumentare la dimensione di APT::Cache-Limit. Il " +"MMap dinamica esaurita. Aumentare la dimensione di APT::Cache-Start. Il " "valore attuale è: %lu (man 5 apt.conf)." #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/ja.po b/po/ja.po index ac1c0fb93..3531765ff 100644 --- a/po/ja.po +++ b/po/ja.po @@ -2289,10 +2289,10 @@ msgstr "ファイルの切り詰めに失敗しました" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"動的 MMap が範囲を越えました。APT::Cache-Limit の大きさを増やしてください。現" +"動的 MMap が範囲を越えました。APT::Cache-Start の大きさを増やしてください。現" "在値は %lu です (man 5 apt.conf を参照)。" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/km.po b/po/km.po index 6c2ea5275..e9bcf9d3a 100644 --- a/po/km.po +++ b/po/km.po @@ -2242,7 +2242,7 @@ msgstr "បរាជ័យ​ក្នុងការ​សរសេរ​ឯក #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ko.po b/po/ko.po index 04565c043..9cd4135df 100644 --- a/po/ko.po +++ b/po/ko.po @@ -2262,10 +2262,10 @@ msgstr "파일을 자르는데 실패했습니다" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"동적 mmap이 한계를 벗어났습니다. APT::Cache-Limit의 크기를 높이십시오. 현재 " +"동적 mmap이 한계를 벗어났습니다. APT::Cache-Start의 크기를 높이십시오. 현재 " "값: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/ku.po b/po/ku.po index 975fd9608..de54b3d0d 100644 --- a/po/ku.po +++ b/po/ku.po @@ -2086,7 +2086,7 @@ msgstr "Nivîsîna pelê %s biserneket" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/lt.po b/po/lt.po index d3d28c856..c63c8f374 100644 --- a/po/lt.po +++ b/po/lt.po @@ -2180,7 +2180,7 @@ msgstr "Nepavyko patikrinti %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/mr.po b/po/mr.po index fe19ac652..7c6a58d2b 100644 --- a/po/mr.po +++ b/po/mr.po @@ -2247,7 +2247,7 @@ msgstr "फाईल छोटी करणे असफल" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/nb.po b/po/nb.po index 8b9d98123..3b9875ff2 100644 --- a/po/nb.po +++ b/po/nb.po @@ -2281,10 +2281,10 @@ msgstr "Klarte ikke forkorte fila %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Dynamisk MMap gikk tom for minne. Øk størrelsen på APT::Cache-Limit. " +"Dynamisk MMap gikk tom for minne. Øk størrelsen på APT::Cache-Start. " "Nåværende verdi: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/ne.po b/po/ne.po index 2761f0b2a..084acb48a 100644 --- a/po/ne.po +++ b/po/ne.po @@ -2244,7 +2244,7 @@ msgstr "फाइल %s लेख्न असफल भयो" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/nl.po b/po/nl.po index 114bee569..c6cf6dcee 100644 --- a/po/nl.po +++ b/po/nl.po @@ -2308,11 +2308,11 @@ msgstr "Afkorten van bestand is mislukt" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Onvoldoende ruimte voor Dynamische MMap. Gelieve de grootte van APT::Cache-" -"Limit te verhogen. Huidige waarde: %lu. (man 5 apt.conf)" +"Start te verhogen. Huidige waarde: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/nn.po b/po/nn.po index 170c65c2b..bdc50d036 100644 --- a/po/nn.po +++ b/po/nn.po @@ -2257,7 +2257,7 @@ msgstr "Klarte ikkje skriva fila %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/pl.po b/po/pl.po index 61f20d2bb..877ed20eb 100644 --- a/po/pl.po +++ b/po/pl.po @@ -2340,11 +2340,11 @@ msgstr "Nie udało się uciąć zawartości pliku %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Brak miejsca dla dynamicznego MMap. Proszę zwiększyć rozmiar APT::Cache-" -"Limit. Aktualna wartość: %lu. (man 5 apt.conf)" +"Start. Aktualna wartość: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/pt.po b/po/pt.po index 93af7dbb3..4a2c1b57c 100644 --- a/po/pt.po +++ b/po/pt.po @@ -2307,11 +2307,11 @@ msgstr "Falhou truncar o ficheiro" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "O Dynamic MMap ficou sem espaço. Por favor aumente o tamanho de APT::Cache-" -"Limit. Valor actual: %lu. (man 5 apt.conf)" +"Start. Valor actual: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index 930ec79a3..3f352079f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -2289,7 +2289,7 @@ msgstr "Falhou ao truncar arquivo" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ro.po b/po/ro.po index e1556214a..584eca389 100644 --- a/po/ro.po +++ b/po/ro.po @@ -2299,7 +2299,7 @@ msgstr "Eșec la trunchierea fișierului" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/ru.po b/po/ru.po index 6da85af7e..153d22624 100644 --- a/po/ru.po +++ b/po/ru.po @@ -2338,10 +2338,10 @@ msgstr "Не удалось обрезать файл" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Не хватает места для Dynamic MMap. Увеличьте значение APT::Cache-Limit. " +"Не хватает места для Dynamic MMap. Увеличьте значение APT::Cache-Start. " "Текущее значение: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/sk.po b/po/sk.po index 803fab0d5..c913a1dbf 100644 --- a/po/sk.po +++ b/po/sk.po @@ -2300,11 +2300,11 @@ msgstr "Nepodarilo sa skrátiť súbor" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Nedostatok miesta pre dynamický MMap. Prosím, zväčšite veľkosť APT::Cache-" -"Limit. Aktuálna hodnota: %lu. (man 5 apt.conf)" +"Start. Aktuálna hodnota: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format diff --git a/po/sl.po b/po/sl.po index 7bf3076be..816fc7202 100644 --- a/po/sl.po +++ b/po/sl.po @@ -2301,11 +2301,11 @@ msgstr "Ni mogoče obrezati datoteke" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Dinamičnemu MMap je zmanjkalo prostora. Povečajte velikost APT::Omejitev-" -"Predpomnilnika. Trenutna vrednost: %lu. (man 5 apt.conf)" +"Dinamičnemu MMap je zmanjkalo prostora. Povečajte velikost APT::Cache-" +"Start. Trenutna vrednost: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 #, c-format @@ -2786,7 +2786,7 @@ msgid "" "under APT::Immediate-Configure for details. (%d)" msgstr "" "Ni mogoče izvesti takojąnje nastavitve na '%s'. Oglejte si man5 apt.conf pod " -"APT::Takojąnja-nastavitev za podrobnosti. (%d)" +"APT::Immediate-Configure za podrobnosti. (%d)" #: apt-pkg/packagemanager.cc:473 apt-pkg/packagemanager.cc:503 #, c-format @@ -2820,7 +2820,7 @@ msgid "" "Error, pkgProblemResolver::Resolve generated breaks, this may be caused by " "held packages." msgstr "" -"Napaka. pkgProblemResolver::Napake pri razrešitvi, ki so jih morda " +"Napaka. pkgProblemResolver::Resolve pri razrešitvi, ki so jih morda " "povzročili zadržani paketi." #: apt-pkg/algorithms.cc:1225 diff --git a/po/sv.po b/po/sv.po index b860d1874..2919c9416 100644 --- a/po/sv.po +++ b/po/sv.po @@ -2299,10 +2299,10 @@ msgstr "Misslyckades med att kapa av filen" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"Dynamisk MMap fick slut på utrymme. Öka storleken för APT::Cache-Limit. " +"Dynamisk MMap fick slut på utrymme. Öka storleken för APT::Cache-Start. " "Aktuellt värde: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/th.po b/po/th.po index f1c75bcfa..9ca45cba1 100644 --- a/po/th.po +++ b/po/th.po @@ -2230,7 +2230,7 @@ msgstr "ไม่สามารถตัดท้ายแฟ้ม" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/tl.po b/po/tl.po index 666d3245c..7a551a643 100644 --- a/po/tl.po +++ b/po/tl.po @@ -2279,7 +2279,7 @@ msgstr "Bigo sa pagsulat ng talaksang %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/uk.po b/po/uk.po index 3ce9dbc9f..87aeafa62 100644 --- a/po/uk.po +++ b/po/uk.po @@ -2294,7 +2294,7 @@ msgstr "Не вдалося записати файл %s" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" diff --git a/po/vi.po b/po/vi.po index 034c5d612..361a995fc 100644 --- a/po/vi.po +++ b/po/vi.po @@ -2308,11 +2308,11 @@ msgstr "Lỗi cắt ngắn tập tin" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" "Dynamic MMap (ảnh xạ bộ nhớ động) đã hết sức chứa.\n" -"Hãy tăng kích cỡ của « APT::Cache-Limit » (giới hạn vùng nhớ tạm Apt).\n" +"Hãy tăng kích cỡ của « APT::Cache-Start » (giới hạn vùng nhớ tạm Apt).\n" "Giá trị hiện thời: %lu. (man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/zh_CN.po b/po/zh_CN.po index 2b1a86636..7e2865552 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -2233,10 +2233,10 @@ msgstr "无法截断文件" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"动态 MMap 没有空间了。请增大 APT::Cache-Limit 的大小。当前值:%lu。(man 5 " +"动态 MMap 没有空间了。请增大 APT::Cache-Start 的大小。当前值:%lu。(man 5 " "apt.conf)" #: apt-pkg/contrib/mmap.cc:429 diff --git a/po/zh_TW.po b/po/zh_TW.po index 573c48b1c..b6abc8cad 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -2231,10 +2231,10 @@ msgstr "無法截短檔案" #: apt-pkg/contrib/mmap.cc:330 #, c-format msgid "" -"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. " +"Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. " "Current value: %lu. (man 5 apt.conf)" msgstr "" -"動態 MMap 已用完所有空間。請增加 APT::Cache-Limit 的大小。目前大小為:%lu。" +"動態 MMap 已用完所有空間。請增加 APT::Cache-Start 的大小。目前大小為:%lu。" "(man 5 apt.conf)" #: apt-pkg/contrib/mmap.cc:429 -- cgit v1.2.3-70-g09d2 From 7b15b702b1f908595a2ae484117746587f8e03aa Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 24 Jul 2012 16:19:56 +0200 Subject: trigger the usage of the fallback code for kfreebsd also in the second (filebased) constructor of DynamicMMap (Closes: #677704) --- apt-pkg/contrib/mmap.cc | 12 +++++++++++- debian/changelog | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index f0ab49265..aaa9da44f 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -216,7 +216,17 @@ DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long const &Work { if (_error->PendingError() == true) return; - + + // disable Moveable if we don't grow + if (Grow == 0) + this->Flags &= ~Moveable; + +#ifndef __linux__ + // kfreebsd doesn't have mremap, so we use the fallback + if ((this->Flags & Moveable) == Moveable) + this->Flags |= Fallback; +#endif + unsigned long long EndOfFile = Fd->Size(); if (EndOfFile > WorkSpace) WorkSpace = EndOfFile; diff --git a/debian/changelog b/debian/changelog index ea15159c8..25f658fe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ apt (0.9.7.3) UNRELEASED; urgency=low - do not segfault if nothing can be configured to statisfy a pre-depends (e.g. in a pre-depends loop) (Closes: #681958) * apt-pkg/contrib/mmap.cc: + - trigger the usage of the fallback code for kfreebsd also in the + second (filebased) constructor of DynamicMMap (Closes: #677704) - refer to APT::Cache-Start in case the growing failed as if -Limit is really the offender it will be noted in a previous error message. -- cgit v1.2.3-70-g09d2 From fbda0ee9d9f5ecd34d38f0e416837e8ef3a10f68 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 24 Jul 2012 17:22:25 +0200 Subject: for filesystems not supporting mmap'ing a file we need to use a SyncToFd dummy just as we did for compressed files in 0.9.5 --- apt-pkg/contrib/mmap.cc | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index aaa9da44f..3e6ef3520 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -102,6 +102,7 @@ bool MMap::Map(FileFd &Fd) { // for readonly, we don't need sync, so make it simple Base = malloc(iSize); + SyncToFd = new FileFd(); return Fd.Read(Base, iSize); } // FIXME: Writing to compressed fd's ? diff --git a/debian/changelog b/debian/changelog index 25f658fe3..eb3c39e3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ apt (0.9.7.3) UNRELEASED; urgency=low second (filebased) constructor of DynamicMMap (Closes: #677704) - refer to APT::Cache-Start in case the growing failed as if -Limit is really the offender it will be noted in a previous error message. + - for filesystems not supporting mmap'ing a file we need to use a + SyncToFd dummy just as we did for compressed files in 0.9.5 -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 -- cgit v1.2.3-70-g09d2 From 3ac981df108470b42b89d0d4a816a5e3ba58c501 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 4 Aug 2012 10:20:30 +0200 Subject: apt-pkg/contrib/mmap.cc: - guard only the msync call with _POSIX_SYNCHRONIZED_IO rather than also the fallback code as it breaks APT on hurd since 0.9.7.3 as the fallback is now always used on non-linux (Closes: #683354) --- apt-pkg/contrib/mmap.cc | 14 +++++++------- debian/changelog | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 3e6ef3520..df7cd2a59 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -156,11 +156,10 @@ bool MMap::Close(bool DoSync) /* This is done in syncronous mode - the docs indicate that this will not return till all IO is complete */ bool MMap::Sync() -{ +{ if ((Flags & UnMapped) == UnMapped) return true; - -#ifdef _POSIX_SYNCHRONIZED_IO + if ((Flags & ReadOnly) != ReadOnly) { if (SyncToFd != NULL) @@ -170,11 +169,12 @@ bool MMap::Sync() } else { +#ifdef _POSIX_SYNCHRONIZED_IO if (msync((char *)Base, iSize, MS_SYNC) < 0) return _error->Errno("msync", _("Unable to synchronize mmap")); +#endif } } -#endif return true; } /*}}}*/ @@ -185,8 +185,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) { if ((Flags & UnMapped) == UnMapped) return true; - -#ifdef _POSIX_SYNCHRONIZED_IO + unsigned long long PSize = sysconf(_SC_PAGESIZE); if ((Flags & ReadOnly) != ReadOnly) { @@ -198,11 +197,12 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) } else { +#ifdef _POSIX_SYNCHRONIZED_IO if (msync((char *)Base+(unsigned long long)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0) return _error->Errno("msync", _("Unable to synchronize mmap")); +#endif } } -#endif return true; } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 3aa1f7e86..2ad1134a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,12 @@ apt (0.9.7.4) UNRELEASED; urgency=low [ Program translation updates ] * Polish (Michał Kułach) + [ Pino Toscano ] + * apt-pkg/contrib/mmap.cc: + - guard only the msync call with _POSIX_SYNCHRONIZED_IO rather + than also the fallback code as it breaks APT on hurd since 0.9.7.3 + as the fallback is now always used on non-linux (Closes: #683354) + -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 apt (0.9.7.3) UNRELEASED; urgency=low -- cgit v1.2.3-70-g09d2 From e3348f474f0251a4be0cb0cb7ae8a07ad746311b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 4 Aug 2012 10:24:47 +0200 Subject: move the sysconf call behind the _POSIX_SYNCHRONIZED_IO guard there it is used for the msync call --- apt-pkg/contrib/mmap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index df7cd2a59..a176da636 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -186,7 +186,6 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) if ((Flags & UnMapped) == UnMapped) return true; - unsigned long long PSize = sysconf(_SC_PAGESIZE); if ((Flags & ReadOnly) != ReadOnly) { if (SyncToFd != 0) @@ -198,6 +197,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) else { #ifdef _POSIX_SYNCHRONIZED_IO + unsigned long long const PSize = sysconf(_SC_PAGESIZE); if (msync((char *)Base+(unsigned long long)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0) return _error->Errno("msync", _("Unable to synchronize mmap")); #endif -- cgit v1.2.3-70-g09d2 From b019fbab5548a70ac4f274f0aceb8a3b04cb1025 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 4 Aug 2012 10:39:27 +0200 Subject: * apt-pkg/contrib/fileutl.cc: - remove _POSIX_SYNCHRONIZED_IO guard in FileFd::Sync() around fsync as this guard is only needed for fdatasync and not defined on hurd --- apt-pkg/contrib/fileutl.cc | 2 -- debian/changelog | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 119cd1974..90e49cbfa 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1748,13 +1748,11 @@ bool FileFd::Close() /* */ bool FileFd::Sync() { -#ifdef _POSIX_SYNCHRONIZED_IO if (fsync(iFd) != 0) { Flags |= Fail; return _error->Errno("sync",_("Problem syncing the file")); } -#endif return true; } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 2ad1134a8..5218ff0cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,11 @@ apt (0.9.7.4) UNRELEASED; urgency=low than also the fallback code as it breaks APT on hurd since 0.9.7.3 as the fallback is now always used on non-linux (Closes: #683354) + [ David Kalnischkies ] + * apt-pkg/contrib/fileutl.cc: + - remove _POSIX_SYNCHRONIZED_IO guard in FileFd::Sync() around fsync + as this guard is only needed for fdatasync and not defined on hurd + -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 apt (0.9.7.3) UNRELEASED; urgency=low -- cgit v1.2.3-70-g09d2 From d5da93b83f886b87958e52d4658b9f08b255b36c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 5 Aug 2012 12:36:46 +0200 Subject: * apt-pkg/indexcopy.cc: - do not use atomic writing if the target is /dev/null as we don't want to replace it, not even automically. (Closes: #683410) --- apt-pkg/indexcopy.cc | 7 ++++++- debian/changelog | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index e29e2819c..c97445326 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -810,9 +810,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ (*I).c_str() + CDROM.length()); string TargetF = _config->FindDir("Dir::State::lists") + "partial/"; TargetF += URItoFileName(S); + FileFd Target; if (_config->FindB("APT::CDROM::NoAct",false) == true) + { TargetF = "/dev/null"; - FileFd Target(TargetF,FileFd::WriteAtomic); + Target.Open(TargetF,FileFd::WriteExists); + } else { + Target.Open(TargetF,FileFd::WriteAtomic); + } FILE *TargetFl = fdopen(dup(Target.Fd()),"w"); if (_error->PendingError() == true) return false; diff --git a/debian/changelog b/debian/changelog index 4646762f6..7092d8164 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,9 @@ apt (0.9.7.4) UNRELEASED; urgency=low * doc/apt-verbatim.ent: - denote 'wheezy' as stable codename and 'jessie' as testing codename in the documentation in preparation for release + * apt-pkg/indexcopy.cc: + - do not use atomic writing if the target is /dev/null as we don't want + to replace it, not even automically. (Closes: #683410) -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 -- cgit v1.2.3-70-g09d2 From c1cd1ac2fd051a11ec5c3eafad68b39521594ed6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 5 Aug 2012 14:16:24 +0200 Subject: * apt-pkg/cdrom.cc: - do not link() but rename() the cdroms.list to cdroms.list~ as a backup to ensure that apt-cdrom can be run multiple times (Closes: #676302) --- apt-pkg/cdrom.cc | 4 ++-- debian/changelog | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 8462e8286..699f66fb3 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -413,8 +413,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf) Out.close(); - if (FileExists(DFile) == true && link(DFile.c_str(),string(DFile + '~').c_str()) != 0) - return _error->Errno("link", "Failed to link %s to %s~", DFile.c_str(), DFile.c_str()); + if (FileExists(DFile) == true) + rename(DFile.c_str(), string(DFile + '~').c_str()); if (rename(NewFile.c_str(),DFile.c_str()) != 0) return _error->Errno("rename","Failed to rename %s.new to %s", DFile.c_str(),DFile.c_str()); diff --git a/debian/changelog b/debian/changelog index 7092d8164..3bed49ec0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,9 @@ apt (0.9.7.4) UNRELEASED; urgency=low * apt-pkg/indexcopy.cc: - do not use atomic writing if the target is /dev/null as we don't want to replace it, not even automically. (Closes: #683410) + * apt-pkg/cdrom.cc: + - do not link() but rename() the cdroms.list to cdroms.list~ as a backup + to ensure that apt-cdrom can be run multiple times (Closes: #676302) -- David Kalnischkies Wed, 18 Jul 2012 11:45:57 +0200 -- cgit v1.2.3-70-g09d2 From 96b1e40d56ea25e3ad860ecfa9a25dc84247387c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 13 Aug 2012 17:27:05 +0200 Subject: make netrc parser more robust and parser biger login tokens, thanks to "TJ" (LP: #1008289) --- apt-pkg/contrib/netrc.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index cb7d36088..43abc62ce 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -39,8 +40,8 @@ enum { }; /* make sure we have room for at least this size: */ -#define LOGINSIZE 64 -#define PASSWORDSIZE 64 +#define LOGINSIZE 1024 +#define PASSWORDSIZE 1024 #define NETRC DOT_CHAR "netrc" /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ @@ -123,11 +124,21 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) if (specific_login) state_our_login = !strcasecmp (login, tok); else + { + if (strlen(tok) > LOGINSIZE) + _error->Error("login token too long %i (max: %i)", + strlen(tok), LOGINSIZE); strncpy (login, tok, LOGINSIZE - 1); + } state_login = 0; } else if (state_password) { - if (state_our_login || !specific_login) + if (state_our_login || !specific_login) + { + if (strlen(tok) > PASSWORDSIZE) + _error->Error("password token too long %i (max %i)", + strlen(tok), PASSWORDSIZE); strncpy (password, tok, PASSWORDSIZE - 1); + } state_password = 0; } else if (!strcasecmp ("login", tok)) state_login = 1; @@ -163,8 +174,8 @@ void maybe_add_auth (URI &Uri, string NetRCFile) { if (NetRCFile.empty () == false) { - char login[64] = ""; - char password[64] = ""; + char login[LOGINSIZE] = ""; + char password[PASSWORDSIZE] = ""; char *netrcfile = strdup(NetRCFile.c_str()); // first check for a generic host based netrc entry -- cgit v1.2.3-70-g09d2 From 7735ad0500b6fefef03b2a3dc2a6843e82353e94 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 28 Aug 2012 11:44:26 +0200 Subject: apt-pkg/contrib/netrc.cc: use a slightly smaller login/password size --- apt-pkg/contrib/netrc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 43abc62ce..06059dfc1 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -40,8 +40,8 @@ enum { }; /* make sure we have room for at least this size: */ -#define LOGINSIZE 1024 -#define PASSWORDSIZE 1024 +#define LOGINSIZE 256 +#define PASSWORDSIZE 256 #define NETRC DOT_CHAR "netrc" /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ -- cgit v1.2.3-70-g09d2 From d4b4e5ea2ceb02699e746d52256b3a8ac2d9bda2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Aug 2012 12:21:32 +0200 Subject: * apt-pkg/packagemanager.cc: - unpack versions in case a different version from the package is currently in unpack state to recover from broken system states (like different file in M-A:same package and other dpkg errors) --- apt-pkg/packagemanager.cc | 4 +- debian/changelog | 10 ++ test/integration/framework | 3 +- .../test-unpack-different-version-unpacked | 121 +++++++++++++++++++++ 4 files changed, 136 insertions(+), 2 deletions(-) create mode 100755 test/integration/test-unpack-different-version-unpacked (limited to 'apt-pkg') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index b93bf6ab9..d2d2753a8 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -882,7 +882,9 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c } } // packages which are already unpacked don't need to be unpacked again - else if (Pkg.State() != pkgCache::PkgIterator::NeedsConfigure && Install(Pkg,FileNames[Pkg->ID]) == false) + else if ((instVer != Pkg.CurrentVer() || + ((Cache[Pkg].iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall)) && + Install(Pkg,FileNames[Pkg->ID]) == false) return false; if (Immediate == true) { diff --git a/debian/changelog b/debian/changelog index b04867843..840033648 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +apt (0.9.7.5) UNRELEASED; urgency=low + + [ David Kalnischkies ] + * apt-pkg/packagemanager.cc: + - unpack versions in case a different version from the package + is currently in unpack state to recover from broken system states + (like different file in M-A:same package and other dpkg errors) + + -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 + apt (0.9.7.4) unstable; urgency=low [ Manpages translation updates ] diff --git a/test/integration/framework b/test/integration/framework index da85d2332..05878d0a4 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -523,11 +523,12 @@ insertinstalledpackage() { local VERSION="$3" local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" + local STATUS="${6:-install ok installed}" local FILE='rootdir/var/lib/dpkg/status' local INFO='rootdir/var/lib/dpkg/info' for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do echo "Package: $NAME -Status: install ok installed +Status: $STATUS Priority: $PRIORITY Section: other Installed-Size: 42 diff --git a/test/integration/test-unpack-different-version-unpacked b/test/integration/test-unpack-different-version-unpacked new file mode 100755 index 000000000..952f6e6b2 --- /dev/null +++ b/test/integration/test-unpack-different-version-unpacked @@ -0,0 +1,121 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'libqtcore4' 'i386,amd64' '2' 'Multi-Arch: same' +setupaptarchive + +DPKGSTATUS='rootdir/var/lib/dpkg/status' +cp $DPKGSTATUS dpkg.status + +cleanstatus() { + cp dpkg.status $DPKGSTATUS + rm rootdir/var/cache/apt/*.bin +} + +#FIXME: the reported version is wrong, it should be 1, not 2 +insertinstalledpackage 'libqtcore4' 'i386,amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked' +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. +2 not fully installed or removed. +Conf libqtcore4 (2 unstable [amd64]) +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked' +insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok unpacked' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4:i386 +The following packages will be upgraded: + libqtcore4:i386 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +2 not fully installed or removed. +Inst libqtcore4:i386 [1] (2 unstable [i386]) +Conf libqtcore4:i386 (2 unstable [i386]) +Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same' '' 'install ok unpacked' +insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4 +The following packages will be upgraded: + libqtcore4 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +2 not fully installed or removed. +Inst libqtcore4 [1] (2 unstable [amd64]) +Conf libqtcore4 (2 unstable [amd64]) +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked' +insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4:i386 +The following packages will be upgraded: + libqtcore4:i386 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst libqtcore4:i386 [1] (2 unstable [i386]) +Conf libqtcore4:i386 (2 unstable [i386]) +Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same' '' 'install ok unpacked' +insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4 +The following packages will be upgraded: + libqtcore4 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst libqtcore4 [1] (2 unstable [amd64]) +Conf libqtcore4 (2 unstable [amd64]) +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' +insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok unpacked' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4:i386 +The following packages will be upgraded: + libqtcore4:i386 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst libqtcore4:i386 [1] (2 unstable [i386]) +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f + +cleanstatus +insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same' +insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked' +testequal 'Reading package lists... +Building dependency tree... +Correcting dependencies... Done +The following extra packages will be installed: + libqtcore4 +The following packages will be upgraded: + libqtcore4 +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst libqtcore4 [1] (2 unstable [amd64]) +Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f -- cgit v1.2.3-70-g09d2 From d29a5330af408747363c944767f1af2212658bd1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 2 Sep 2012 18:31:07 +0200 Subject: * apt-pkg/indexcopy.cc: - do not create duplicated flat-archive cdrom sources for foreign architectures on multi-arch cdroms --- apt-pkg/indexcopy.cc | 11 ++-- debian/changelog | 4 +- test/libapt/indexcopytosourcelist_test.cc | 86 +++++++++++++++++++++++++++++++ test/libapt/makefile | 6 +++ 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 test/libapt/indexcopytosourcelist_test.cc (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index c97445326..24defd82c 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -350,9 +350,6 @@ bool IndexCopy::ReconstructChop(unsigned long &Chop,string Dir,string File) */ void IndexCopy::ConvertToSourceList(string CD,string &Path) { - char S[300]; - snprintf(S,sizeof(S),"binary-%s",_config->Find("Apt::Architecture").c_str()); - // Strip the cdrom base path Path = string(Path,CD.length()); if (Path.empty() == true) @@ -388,7 +385,13 @@ void IndexCopy::ConvertToSourceList(string CD,string &Path) return; string Binary = string(Path,Slash+1,BinSlash - Slash-1); - if (Binary != S && Binary != "source") + if (strncmp(Binary.c_str(), "binary-", strlen("binary-")) == 0) + { + Binary.erase(0, strlen("binary-")); + if (APT::Configuration::checkArchitecture(Binary) == false) + continue; + } + else if (Binary != "source") continue; Path = Dist + ' ' + Comp; diff --git a/debian/changelog b/debian/changelog index a673040c5..4533d27e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,7 +15,9 @@ apt (0.9.7.5) UNRELEASED; urgency=low * doc/apt_preferences.5.xml: - use the correct interval (x <= P < y) for pin value documentation as these are the intervals used by the code (Closes: #685989) - * + * apt-pkg/indexcopy.cc: + - do not create duplicated flat-archive cdrom sources for foreign + architectures on multi-arch cdroms -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc new file mode 100644 index 000000000..69d8fae86 --- /dev/null +++ b/test/libapt/indexcopytosourcelist_test.cc @@ -0,0 +1,86 @@ +#include +#include +#include + +#include + +#include "assert.h" + +class NoCopy : public IndexCopy { +public: + std::string ConvertToSourceList(std::string CD,std::string Path) { + IndexCopy::ConvertToSourceList(CD, Path); + return Path; + } + bool GetFile(std::string &Filename,unsigned long long &Size) { return false; } + bool RewriteEntry(FILE *Target,std::string File) { return false; } + const char *GetFileName() { return NULL; } + const char *Type() { return NULL; } + +}; + +int main(int argc, char const *argv[]) { + NoCopy ic; + std::string const CD("/media/cdrom/"); + + char const * Releases[] = { "unstable", "wheezy-updates", NULL }; + char const * Components[] = { "main", "non-free", NULL }; + + for (char const ** Release = Releases; *Release != NULL; ++Release) { + for (char const ** Component = Components; *Component != NULL; ++Component) { + std::string const Path = std::string("dists/") + *Release + "/" + *Component + "/"; + std::string const Binary = Path + "binary-"; + std::string const A = Binary + "armel/"; + std::string const B = Binary + "mips/"; + std::string const C = Binary + "kfreebsd-mips/"; + std::string const S = Path + "source/"; + std::string const List = std::string(*Release) + " " + *Component; + + _config->Clear("APT"); + APT::Configuration::getArchitectures(false); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + A), A); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + B), B); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + C), C); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + S), List); + + _config->Clear("APT"); + _config->Set("APT::Architecture", "mips"); + _config->Set("APT::Architectures::", "mips"); + APT::Configuration::getArchitectures(false); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + A), A); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + B), List); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + C), C); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + S), List); + + _config->Clear("APT"); + _config->Set("APT::Architecture", "kfreebsd-mips"); + _config->Set("APT::Architectures::", "kfreebsd-mips"); + APT::Configuration::getArchitectures(false); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + A), A); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + B), B); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + C), List); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + S), List); + + _config->Clear("APT"); + _config->Set("APT::Architecture", "armel"); + _config->Set("APT::Architectures::", "armel"); + APT::Configuration::getArchitectures(false); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + A), List); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + B), B); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + C), C); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + S), List); + + _config->Clear("APT"); + _config->Set("APT::Architecture", "armel"); + _config->Set("APT::Architectures::", "armel"); + _config->Set("APT::Architectures::", "mips"); + APT::Configuration::getArchitectures(false); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + A), List); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + B), List); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + C), C); + equals(ic.ConvertToSourceList("/media/cdrom/", CD + S), List); + } + } + + return 0; +} diff --git a/test/libapt/makefile b/test/libapt/makefile index b2e6db2dd..d4d7f175b 100644 --- a/test/libapt/makefile +++ b/test/libapt/makefile @@ -86,3 +86,9 @@ PROGRAM = CdromFindPackages${BASENAME} SLIBS = -lapt-pkg SOURCE = cdromfindpackages_test.cc include $(PROGRAM_H) + +# text IndexCopy::ConvertToSourceList +PROGRAM = IndexCopyToSourceList${BASENAME} +SLIBS = -lapt-pkg +SOURCE = indexcopytosourcelist_test.cc +include $(PROGRAM_H) -- cgit v1.2.3-70-g09d2 From 8628c2f7a6a8769a6250280d62791a8429aa71ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 2 Sep 2012 21:32:40 +0200 Subject: * apt-pkg/cdrom.cc: - handle Components in the reduction for the source.list as multi-arch cds otherwise create duplicated source entries (e.g. "wheezy main main") --- apt-pkg/cdrom.cc | 9 ++-- debian/changelog | 3 ++ test/libapt/cdromreducesourcelist_test.cc | 86 +++++++++++++++++++++++++++++++ test/libapt/makefile | 6 +++ 4 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 test/libapt/cdromreducesourcelist_test.cc (limited to 'apt-pkg') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 699f66fb3..8e746ee30 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -363,6 +363,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector &List) string Word1 = string(*I,Space,SSpace-Space); string Prefix = string(*I,0,Space); + string Component = string(*I,SSpace); for (vector::iterator J = List.begin(); J != I; ++J) { // Find a space.. @@ -377,9 +378,11 @@ void pkgCdrom::ReduceSourcelist(string CD,vector &List) continue; if (string(*J,Space2,SSpace2-Space2) != Word1) continue; - - *J += string(*I,SSpace); - *I = string(); + + string Component2 = string(*J, SSpace2) + " "; + if (Component2.find(Component + " ") == std::string::npos) + *J += Component; + I->clear(); } } diff --git a/debian/changelog b/debian/changelog index 4533d27e3..703764dec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ apt (0.9.7.5) UNRELEASED; urgency=low * apt-pkg/indexcopy.cc: - do not create duplicated flat-archive cdrom sources for foreign architectures on multi-arch cdroms + * apt-pkg/cdrom.cc: + - handle Components in the reduction for the source.list as multi-arch cds + otherwise create duplicated source entries (e.g. "wheezy main main") -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 diff --git a/test/libapt/cdromreducesourcelist_test.cc b/test/libapt/cdromreducesourcelist_test.cc new file mode 100644 index 000000000..729da23a6 --- /dev/null +++ b/test/libapt/cdromreducesourcelist_test.cc @@ -0,0 +1,86 @@ +#include +#include + +#include +#include +#include + +#include "assert.h" + +class Cdrom : public pkgCdrom { +public: + std::vector ReduceSourcelist(std::string CD,std::vector List) { + pkgCdrom::ReduceSourcelist(CD, List); + return List; + } +}; + +int main(int argc, char const *argv[]) { + Cdrom cd; + std::vector List; + std::string CD("/media/cdrom/"); + + std::vector R = cd.ReduceSourcelist(CD, List); + equals(R.empty(), true); + + List.push_back(" wheezy main"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 1); + equals(R[0], " wheezy main"); + + List.push_back(" wheezy main"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 1); + equals(R[0], " wheezy main"); + + List.push_back(" wheezy contrib"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 1); + equals(R[0], " wheezy contrib main"); + + List.push_back(" wheezy-update contrib"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 2); + equals(R[0], " wheezy contrib main"); + equals(R[1], " wheezy-update contrib"); + + List.push_back(" wheezy-update contrib"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 2); + equals(R[0], " wheezy contrib main"); + equals(R[1], " wheezy-update contrib"); + + List.push_back(" wheezy-update non-free"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 2); + equals(R[0], " wheezy contrib main"); + equals(R[1], " wheezy-update contrib non-free"); + + List.push_back(" wheezy-update main"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 2); + equals(R[0], " wheezy contrib main"); + equals(R[1], " wheezy-update contrib main non-free"); + + List.push_back(" wheezy non-free"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 2); + equals(R[0], " wheezy contrib main non-free"); + equals(R[1], " wheezy-update contrib main non-free"); + + List.push_back(" sid main"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 3); + equals(R[0], " sid main"); + equals(R[1], " wheezy contrib main non-free"); + equals(R[2], " wheezy-update contrib main non-free"); + + List.push_back(" sid main-reduce"); + R = cd.ReduceSourcelist(CD, List); + equals(R.size(), 3); + equals(R[0], " sid main main-reduce"); + equals(R[1], " wheezy contrib main non-free"); + equals(R[2], " wheezy-update contrib main non-free"); + + return 0; +} diff --git a/test/libapt/makefile b/test/libapt/makefile index d4d7f175b..5e225f240 100644 --- a/test/libapt/makefile +++ b/test/libapt/makefile @@ -87,6 +87,12 @@ SLIBS = -lapt-pkg SOURCE = cdromfindpackages_test.cc include $(PROGRAM_H) +# test cdroms index reduction for source.list +PROGRAM = CdromReduceSourceList${BASENAME} +SLIBS = -lapt-pkg +SOURCE = cdromreducesourcelist_test.cc +include $(PROGRAM_H) + # text IndexCopy::ConvertToSourceList PROGRAM = IndexCopyToSourceList${BASENAME} SLIBS = -lapt-pkg -- cgit v1.2.3-70-g09d2 From 12c7078f5098d7f26599a3761af9e24b392d9c1d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Sep 2012 12:26:34 +0200 Subject: - do not create duplicated flat-archive CD-ROM sources for foreign architectures on multi-arch CD-ROMs - do not warn about files which have a record in the Release file, but are not present on the CD to mirror the behavior of the other methods and to allow uncompressed indexes to be dropped without scaring users - handle Components in the reduction for the source.list as multi-arch CDs --- apt-pkg/indexcopy.cc | 15 +++++++++------ debian/changelog | 9 ++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 24defd82c..aa1f01a4a 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -497,17 +497,20 @@ bool SourceCopy::RewriteEntry(FILE *Target,string File) bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) { const indexRecords::checkSum *Record = MetaIndex->Lookup(file); + bool const Debug = _config->FindB("Debug::aptcdrom",false); - // we skip non-existing files in the verifcation to support a cdrom - // with no Packages file (just a Package.gz), see LP: #255545 - // (non-existing files are not considered a error) + // we skip non-existing files in the verifcation of the Release file + // as non-existing files do not harm, but a warning scares people and + // makes it hard to strip unneeded files from an ISO like uncompressed + // indexes as it is done on the mirrors (see also LP: #255545 ) if(!RealFileExists(prefix+file)) { - _error->Warning(_("Skipping nonexistent file %s"), string(prefix+file).c_str()); + if (Debug == true) + cout << "Skipping nonexistent in " << prefix << " file " << file << std::endl; return true; } - if (!Record) + if (!Record) { _error->Warning(_("Can't find authentication record for: %s"), file.c_str()); return false; @@ -519,7 +522,7 @@ bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) return false; } - if(_config->FindB("Debug::aptcdrom",false)) + if(Debug == true) { cout << "File: " << prefix+file << endl; cout << "Expected Hash " << Record->Hash.toStr() << endl; diff --git a/debian/changelog b/debian/changelog index 703764dec..6800c9864 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,10 +16,13 @@ apt (0.9.7.5) UNRELEASED; urgency=low - use the correct interval (x <= P < y) for pin value documentation as these are the intervals used by the code (Closes: #685989) * apt-pkg/indexcopy.cc: - - do not create duplicated flat-archive cdrom sources for foreign - architectures on multi-arch cdroms + - do not create duplicated flat-archive CD-ROM sources for foreign + architectures on multi-arch CD-ROMs + - do not warn about files which have a record in the Release file, but + are not present on the CD to mirror the behavior of the other methods + and to allow uncompressed indexes to be dropped without scaring users * apt-pkg/cdrom.cc: - - handle Components in the reduction for the source.list as multi-arch cds + - handle Components in the reduction for the source.list as multi-arch CDs otherwise create duplicated source entries (e.g. "wheezy main main") -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 -- cgit v1.2.3-70-g09d2 From c45233eaf6d08bb6bb6e2dbb57c90a1d52ca9a43 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Sep 2012 12:28:19 +0200 Subject: * apt-pkg/cdrom.cc: - copy only configured translation files from a CD-ROM and not all available translation files preventing new installs with d-i from being initialized with all translations (Closes: #678227) - handle Components in the reduction for the source.list as multi-arch CDs otherwise create duplicated source entries (e.g. "wheezy main main") --- apt-pkg/aptconfiguration.cc | 11 +++++ apt-pkg/aptconfiguration.h | 8 ++++ apt-pkg/cdrom.cc | 25 ++++++++++ apt-pkg/cdrom.h | 1 + debian/changelog | 9 ++-- test/integration/framework | 16 +++++++ test/integration/test-apt-cdrom | 104 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 171 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-apt-cdrom (limited to 'apt-pkg') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index d31ccb642..653775688 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -319,6 +319,17 @@ std::vector const Configuration::getLanguages(bool const &All, return codes; } /*}}}*/ +// checkLanguage - are we interested in the given Language? /*{{{*/ +bool const Configuration::checkLanguage(std::string Lang, bool const All) { + // the empty Language is always interesting as it is the original + if (Lang.empty() == true) + return true; + // filenames are encoded, so undo this + Lang = SubstVar(Lang, "%5f", "_"); + std::vector const langs = getLanguages(All, true); + return (std::find(langs.begin(), langs.end(), Lang) != langs.end()); +} + /*}}}*/ // getArchitectures - Return Vector of prefered Architectures /*{{{*/ std::vector const Configuration::getArchitectures(bool const &Cached) { using std::string; diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index e098d0fd6..516f451d9 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -67,6 +67,14 @@ public: /*{{{*/ std::vector static const getLanguages(bool const &All = false, bool const &Cached = true, char const ** const Locale = 0); + /** \brief Are we interested in the given Language? + * + * \param Lang is the language we want to check + * \param All defines if we check against all codes or only against used codes + * \return true if we are interested, false otherwise + */ + bool static const Configuration::checkLanguage(std::string Lang, bool const All = false); + /** \brief Returns a vector of Architectures we support * * \param Cached saves the result so we need to calculated it only once diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 8e746ee30..9a9a854bf 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -269,6 +269,29 @@ bool pkgCdrom::DropBinaryArch(vector &List) --I; // the next entry is at the same index after the erase } + return true; +} + /*}}}*/ +// DropTranslation - Dump unwanted Translation- files /*{{{*/ +// --------------------------------------------------------------------- +/* Here we drop everything that is not configured in Acquire::Languages */ +bool pkgCdrom::DropTranslation(vector &List) +{ + for (unsigned int I = 0; I < List.size(); I++) + { + const char *Start; + if ((Start = strstr(List[I].c_str(), "/Translation-")) == NULL) + continue; + Start += strlen("/Translation-"); + + if (APT::Configuration::checkLanguage(Start, true) == true) + continue; + + // not accepted -> Erase it + List.erase(List.begin() + I); + --I; // the next entry is at the same index after the erase + } + return true; } /*}}}*/ @@ -714,6 +737,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ DropRepeats(SigList,"InRelease"); _error->RevertToStack(); DropRepeats(TransList,""); + if (_config->FindB("APT::CDROM::DropTranslation", true) == true) + DropTranslation(TransList); if(log != NULL) { msg.str(""); ioprintf(msg, _("Found %zu package indexes, %zu source indexes, " diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index cedfccff7..4fc3d3928 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -60,6 +60,7 @@ class pkgCdrom /*{{{*/ unsigned int Depth = 0); bool DropBinaryArch(std::vector &List); bool DropRepeats(std::vector &List,const char *Name); + bool DropTranslation(std::vector &List); void ReduceSourcelist(std::string CD,std::vector &List); bool WriteDatabase(Configuration &Cnf); bool WriteSourceList(std::string Name,std::vector &List,bool Source); diff --git a/debian/changelog b/debian/changelog index 6800c9864..67566bbe1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,12 @@ apt (0.9.7.5) UNRELEASED; urgency=low * Japanese (KURASAWA Nozomu) (Closes: #684435) [ David Kalnischkies ] + * apt-pkg/cdrom.cc: + - copy only configured translation files from a CD-ROM and not all + available translation files preventing new installs with d-i from + being initialized with all translations (Closes: #678227) + - handle Components in the reduction for the source.list as multi-arch CDs + otherwise create duplicated source entries (e.g. "wheezy main main") * apt-pkg/packagemanager.cc: - unpack versions in case a different version from the package is currently in unpack state to recover from broken system states @@ -21,9 +27,6 @@ apt (0.9.7.5) UNRELEASED; urgency=low - do not warn about files which have a record in the Release file, but are not present on the CD to mirror the behavior of the other methods and to allow uncompressed indexes to be dropped without scaring users - * apt-pkg/cdrom.cc: - - handle Components in the reduction for the source.list as multi-arch CDs - otherwise create duplicated source entries (e.g. "wheezy main main") -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 diff --git a/test/integration/framework b/test/integration/framework index 05878d0a4..57bf555af 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -91,6 +91,7 @@ runapt() { } aptconfig() { runapt apt-config $*; } aptcache() { runapt apt-cache $*; } +aptcdrom() { runapt apt-cdrom $*; } aptget() { runapt apt-get $*; } aptftparchive() { runapt apt-ftparchive $*; } aptkey() { runapt apt-key $*; } @@ -715,6 +716,21 @@ server.stat-cache-engine = \"disable\"" > lighttpd.conf return 0 } +changetocdrom() { + mkdir -p rootdir/media/cdrom/.disk + local CD="$(readlink -f rootdir/media/cdrom)" + echo "acquire::cdrom::mount \"${CD}\";" > rootdir/etc/apt/apt.conf.d/00cdrom + echo 'acquire::cdrom::autodetect 0;' >> rootdir/etc/apt/apt.conf.d/00cdrom + echo -n "$1" > ${CD}/.disk/info + if [ ! -d aptarchive/dists ]; then + msgdie 'Flat file archive cdroms can not be created currently' + return 1 + fi + mv aptarchive/dists $CD + ln -s "$(readlink -f ./incoming)" $CD/pool + find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list' -delete +} + checkdiff() { local DIFFTEXT="$($(which diff) -u $* | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')" if [ -n "$DIFFTEXT" ]; then diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom new file mode 100755 index 000000000..f24c99b36 --- /dev/null +++ b/test/integration/test-apt-cdrom @@ -0,0 +1,104 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable' +setupaptarchive + +changetocdrom 'Debian APT Testdisk 0.8.15' + +# -de is not in the Release file, but picked up anyway for compatibility +cd rootdir/media/cdrom/dists/stable/main/i18n +sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de +echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable + Diese Pakete sind nur für das testen von APT gedacht, + sie erfüllen keinen Zweck auf einem normalen System… +' >> Translation-de +cat Translation-de | gzip > Translation-de.gz +cat Translation-de | bzip2 > Translation-de.bz2 +cat Translation-de | xz --format=lzma > Translation-de.lzma +cat Translation-de | xz > Translation-de.xz +rm Translation-en Translation-de +cd - > /dev/null + +aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 +sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log +testfileequal apt-cdrom.log "Scanning disc for index files.. +Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures +Found label 'Debian APT Testdisk 0.8.15' +This disc is called: +'Debian APT Testdisk 0.8.15' +Writing new source list +Source list entries for this disc are: +deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main +deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main +Repeat this process for the rest of the CDs in your set." + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + testing +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst testing (0.8.15 stable [amd64]) +Conf testing (0.8.15 stable [amd64])' aptget install testing -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + testing:i386 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst testing:i386 (0.8.15 stable [i386]) +Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s + +# check Idempotence of apt-cdrom (and disabling of Translation dropping) +aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1 +sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log +testfileequal apt-cdrom.log "Scanning disc for index files.. +Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures +This disc is called: +'Debian APT Testdisk 0.8.15' +Writing new source list +Source list entries for this disc are: +deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main +deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main +Repeat this process for the rest of the CDs in your set." + +# take Translations from previous runs as needed +aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 +sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log +testfileequal apt-cdrom.log "Scanning disc for index files.. +Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures +This disc is called: +'Debian APT Testdisk 0.8.15' +Writing new source list +Source list entries for this disc are: +deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main +deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main +Repeat this process for the rest of the CDs in your set." +msgtest 'Test for the german description translation of' 'testing' +aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists +mkdir -p rootdir/var/lib/apt/lists/partial +aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 +sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log +testfileequal apt-cdrom.log "Scanning disc for index files.. +Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures +This disc is called: +'Debian APT Testdisk 0.8.15' +Writing new source list +Source list entries for this disc are: +deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main +deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main +Repeat this process for the rest of the CDs in your set." +msgtest 'Test for the english description translation of' 'testing' +aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail + + +# check that we really can install from a 'cdrom' +testdpkgnotinstalled testing +aptget install testing -y > /dev/null 2>&1 +testdpkginstalled testing -- cgit v1.2.3-70-g09d2 From 3663572002ef82c146c125afea8942fe842f25c4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Sep 2012 12:42:22 +0200 Subject: unpack versions only in case a different version from the package and avoid re-unpack otherwise (Closes: #670900) --- apt-pkg/packagemanager.cc | 5 ++++- debian/changelog | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index d2d2753a8..9ca6098fd 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -856,7 +856,10 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c This way we avoid that M-A: enabled packages are installed before their older non-M-A enabled packages are replaced by newer versions */ bool const installed = Pkg->CurrentVer != 0; - if (installed == true && Install(Pkg,FileNames[Pkg->ID]) == false) + if (installed == true && + (instVer != Pkg.CurrentVer() || + ((Cache[Pkg].iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall)) && + Install(Pkg,FileNames[Pkg->ID]) == false) return false; for (PkgIterator P = Pkg.Group().PackageList(); P.end() == false; P = Pkg.Group().NextPkg(P)) diff --git a/debian/changelog b/debian/changelog index 67566bbe1..e62f0b681 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,9 +11,10 @@ apt (0.9.7.5) UNRELEASED; urgency=low - handle Components in the reduction for the source.list as multi-arch CDs otherwise create duplicated source entries (e.g. "wheezy main main") * apt-pkg/packagemanager.cc: - - unpack versions in case a different version from the package + - unpack versions only in case a different version from the package is currently in unpack state to recover from broken system states (like different file in M-A:same package and other dpkg errors) + and avoid re-unpack otherwise (Closes: #670900) * debian/control: - let libapt-pkg break apt < 0.9.4 to ensure that the installed http- method supports the new redirection-style, thanks to Raphael Geissert -- cgit v1.2.3-70-g09d2 From 92f212774bebbff6aabd3081910f570a77180911 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Sep 2012 13:03:02 +0200 Subject: report the package name with architecture in the "no file" error message --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 296426c80..ae9143e0d 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -187,7 +187,7 @@ pkgDPkgPM::~pkgDPkgPM() bool pkgDPkgPM::Install(PkgIterator Pkg,string File) { if (File.empty() == true || Pkg.end() == true) - return _error->Error("Internal Error, No file name for %s",Pkg.Name()); + return _error->Error("Internal Error, No file name for %s",Pkg.FullName().c_str()); // If the filename string begins with DPkg::Chroot-Directory, return the // substr that is within the chroot so dpkg can access it. -- cgit v1.2.3-70-g09d2 From 601c2c8ec3d33a1e787af75f20b51d1131cb6d74 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 4 Sep 2012 15:34:39 +0200 Subject: apt-pkg/aptconfiguration.h: fix compiler error --- apt-pkg/aptconfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index 516f451d9..d22b675c0 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -73,7 +73,7 @@ public: /*{{{*/ * \param All defines if we check against all codes or only against used codes * \return true if we are interested, false otherwise */ - bool static const Configuration::checkLanguage(std::string Lang, bool const All = false); + bool static const checkLanguage(std::string Lang, bool const All = false); /** \brief Returns a vector of Architectures we support * -- cgit v1.2.3-70-g09d2 From c919ad6e4d0de48acb60f2a1371ade9bfb0451f8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Sep 2012 16:03:52 +0200 Subject: handle packages without a mandatory architecture (debian-policy §5.3) by introducing a pseudo-architecture 'none' so that the small group of users with these packages can get right of them without introducing too much hassle for other users (Closes: #686346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/algorithms.cc | 5 ++ apt-pkg/deb/deblistparser.cc | 22 +++++- apt-pkg/deb/dpkgpm.cc | 8 +- apt-pkg/pkgcache.cc | 6 +- apt-pkg/pkgcachegen.cc | 53 ++++++++++++- debian/changelog | 4 + test/integration/framework | 12 +-- .../test-bug-686346-package-missing-architecture | 87 ++++++++++++++++++++++ 8 files changed, 183 insertions(+), 14 deletions(-) create mode 100755 test/integration/test-bug-686346-package-missing-architecture (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 2f5fcc7ab..1b0161ffd 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -194,6 +194,11 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge) { // Adapt the iterator PkgIterator Pkg = Sim.FindPkg(iPkg.Name(), iPkg.Arch()); + if (Pkg.end() == true) + { + std::cerr << (Purge ? "Purg" : "Remv") << " invalid package " << iPkg.FullName() << std::endl; + return false; + } Flags[Pkg->ID] = 3; Sim.MarkDelete(Pkg); diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 12c6ab4c9..b84bd6fdd 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -645,6 +645,8 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, a != Architectures.end(); ++a) if (NewDepends(Ver,Package,*a,Version,Op,Type) == false) return false; + if (NewDepends(Ver,Package,"none",Version,Op,Type) == false) + return false; } else if (MultiArchEnabled == true && found != string::npos && strcmp(Package.c_str() + found, ":any") != 0) @@ -658,8 +660,18 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, if (NewDepends(Ver,Package,Arch,Version,Op,Type) == false) return false; } - else if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false) - return false; + else + { + if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false) + return false; + if ((Type == pkgCache::Dep::Conflicts || + Type == pkgCache::Dep::DpkgBreaks || + Type == pkgCache::Dep::Replaces) && + NewDepends(Ver, Package, + (pkgArch != "none") ? "none" : _config->Find("APT::Architecture"), + Version,Op,Type) == false) + return false; + } if (Start == Stop) break; } @@ -753,13 +765,15 @@ bool debListParser::Step() drop the whole section. A missing arch tag only happens (in theory) inside the Status file, so that is a positive return */ string const Architecture = Section.FindS("Architecture"); - if (Architecture.empty() == true) - return true; if (Arch.empty() == true || Arch == "any" || MultiArchEnabled == false) { if (APT::Configuration::checkArchitecture(Architecture) == true) return true; + /* parse version stanzas without an architecture only in the status file + (and as misfortune bycatch flat-archives) */ + if ((Arch.empty() == true || Arch == "any") && Architecture.empty() == true) + return true; } else { diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index ae9143e0d..c9df41d3a 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1131,7 +1131,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) if (I->Op == Item::Configure && disappearedPkgs.find(I->Pkg.Name()) != disappearedPkgs.end()) continue; // We keep this here to allow "smooth" transitions from e.g. multiarch dpkg/ubuntu to dpkg/debian - if (dpkgMultiArch == false && (I->Pkg.Arch() == nativeArch || !strcmp(I->Pkg.Arch(), "all"))) + if (dpkgMultiArch == false && (I->Pkg.Arch() == nativeArch || + strcmp(I->Pkg.Arch(), "all") == 0 || + strcmp(I->Pkg.Arch(), "none") == 0)) { char const * const name = I->Pkg.Name(); ADDARG(name); @@ -1148,7 +1150,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) } else PkgVer = Cache[I->Pkg].InstVerIter(Cache); - if (PkgVer.end() == false) + if (strcmp(I->Pkg.Arch(), "none") == 0) + ; // never arch-qualify a package without an arch + else if (PkgVer.end() == false) name.append(":").append(PkgVer.Arch()); else _error->Warning("Can not find PkgVer for '%s'", name.c_str()); diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 9acb7da72..353172d8a 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -238,7 +238,7 @@ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) { // --------------------------------------------------------------------- /* Returns 0 on error, pointer to the package otherwise */ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name, string const &Arch) { - if (MultiArchCache() == false) { + if (MultiArchCache() == false && Arch != "none") { if (Arch == "native" || Arch == "all" || Arch == "any" || Arch == NativeArch()) return SingleArchFindPkg(Name); @@ -376,6 +376,10 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPreferredPkg(bool const &Prefer if (Pkg.end() == false && (PreferNonVirtual == false || Pkg->VersionList != 0)) return Pkg; } + // packages without an architecture + Pkg = FindPkg("none"); + if (Pkg.end() == false && (PreferNonVirtual == false || Pkg->VersionList != 0)) + return Pkg; if (PreferNonVirtual == true) return FindPreferredPkg(false); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index f70cbd02a..490c2ecbb 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -200,7 +200,19 @@ bool pkgCacheGenerator::MergeList(ListParser &List, } if (Arch.empty() == true) - Arch = _config->Find("APT::Architecture"); + { + // use the pseudo arch 'none' for arch-less packages + Arch = "none"; + /* We might built a SingleArchCache here, which we don't want to blow up + just for these :none packages to a proper MultiArchCache, so just ensure + that we have always a native package structure first for SingleArch */ + pkgCache::PkgIterator NP; + if (NewPackage(NP, PackageName, _config->Find("APT::Architecture")) == false) + // TRANSLATOR: The first placeholder is a package name, + // the other two should be copied verbatim as they include debug info + return _error->Error(_("Error occurred while processing %s (%s%d)"), + PackageName.c_str(), "NewPackage", 0); + } // Get a pointer to the package structure pkgCache::PkgIterator Pkg; @@ -418,6 +430,42 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 1); } + /* :none packages are packages without an architecture. They are forbidden by + debian-policy, so usually they will only be in (old) dpkg status files - + and dpkg will complain about them - and are pretty rare. We therefore do + usually not create conflicts while the parent is created, but only if a :none + package (= the target) appears. This creates incorrect dependencies on :none + for architecture-specific dependencies on the package we copy from, but we + will ignore this bug as architecture-specific dependencies are only allowed + in jessie and until then the :none packages should be extinct (hopefully). + In other words: This should work long enough to allow graceful removal of + these packages, it is not supposed to allow users to keep using them … */ + if (strcmp(Pkg.Arch(), "none") == 0) + { + pkgCache::PkgIterator M = Grp.FindPreferredPkg(); + if (M.end() == false && Pkg != M) + { + pkgCache::DepIterator D = M.RevDependsList(); + Dynamic DynD(D); + for (; D.end() == false; ++D) + { + if ((D->Type != pkgCache::Dep::Conflicts && + D->Type != pkgCache::Dep::DpkgBreaks && + D->Type != pkgCache::Dep::Replaces) || + D.ParentPkg().Group() == Grp) + continue; + + map_ptrloc *OldDepLast = NULL; + pkgCache::VerIterator ConVersion = D.ParentVer(); + // duplicate the Conflicts/Breaks/Replaces for :none arch + if (D->Version == 0) + NewDepends(Pkg, ConVersion, "", 0, D->Type, OldDepLast); + else + NewDepends(Pkg, ConVersion, D.TargetVer(), + D->CompareOp, D->Type, OldDepLast); + } + } + } } if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false)) return _error->Error(_("Error occurred while processing %s (%s%d)"), @@ -871,6 +919,9 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, // Locate the target package pkgCache::PkgIterator Pkg = Grp.FindPkg(Arch); + // we don't create 'none' packages and their dependencies if we can avoid it … + if (Pkg.end() == true && Arch == "none") + return true; Dynamic DynPkg(Pkg); if (Pkg.end() == true) { if (unlikely(Owner->NewPackage(Pkg, PackageName, Arch) == false)) diff --git a/debian/changelog b/debian/changelog index e62f0b681..90f3199b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ apt (0.9.7.5) UNRELEASED; urgency=low * Japanese (KURASAWA Nozomu) (Closes: #684435) [ David Kalnischkies ] + * handle packages without a mandatory architecture (debian-policy §5.3) + by introducing a pseudo-architecture 'none' so that the small group of + users with these packages can get right of them without introducing too + much hassle for other users (Closes: #686346) * apt-pkg/cdrom.cc: - copy only configured translation files from a CD-ROM and not all available translation files preventing new installs with d-i from diff --git a/test/integration/framework b/test/integration/framework index 57bf555af..1c4872c8e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -468,7 +468,7 @@ insertpackage() { local PRIORITY="${6:-optional}" local ARCHS="" for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do - if [ "$arch" = "all" ]; then + if [ "$arch" = 'all' -o "$arch" = 'none' ]; then ARCHS="$(getarchitectures)" else ARCHS="$arch" @@ -482,9 +482,9 @@ insertpackage() { Priority: $PRIORITY Section: other Installed-Size: 42 -Maintainer: Joe Sixpack -Architecture: $arch -Version: $VERSION +Maintainer: Joe Sixpack " >> $FILE + test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE + echo "Version: $VERSION Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@ -534,8 +534,8 @@ Priority: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack -Architecture: $arch Version: $VERSION" >> $FILE + test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed If you find such a package installed on your system, @@ -818,7 +818,7 @@ testnopackage() { testdpkginstalled() { msgtest "Test for correctly installed package(s) with" "dpkg -l $*" - local PKGS="$(dpkg -l $* | grep '^i' | wc -l)" + local PKGS="$(dpkg -l $* 2>/dev/null | grep '^i' | wc -l)" if [ "$PKGS" != $# ]; then echo $PKGS dpkg -l $* | grep '^[a-z]' diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture new file mode 100755 index 000000000..b0e0aa3c4 --- /dev/null +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'pkgb' 'none' '1' +insertinstalledpackage 'pkgd' 'none' '1' +insertpackage 'unstable' 'pkga' 'amd64' '2' 'Depends: pkgb' +insertpackage 'unstable' 'pkgb' 'amd64' '2' +insertpackage 'unstable' 'pkgc' 'amd64' '1' 'Conflicts: pkgb' +insertpackage 'unstable' 'pkge' 'none' '1' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + pkgb:none +The following NEW packages will be installed: + pkgc +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv pkgb:none [1] +Inst pkgc (1 unstable [amd64]) +Conf pkgc (1 unstable [amd64])' aptget install pkgc -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + pkgb +The following packages will be REMOVED: + pkgb:none +The following NEW packages will be installed: + pkga pkgb +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv pkgb:none [1] +Inst pkgb (2 unstable [amd64]) +Inst pkga (2 unstable [amd64]) +Conf pkgb (2 unstable [amd64]) +Conf pkga (2 unstable [amd64])' aptget install pkga -s + +# ensure that arch-less stanzas from Packages files are ignored +msgtest 'Package is distributed in the Packages files' 'pkge' +grep -q 'Package: pkge' $(find aptarchive -name 'Packages') && msgpass || msgfail +testnopackage pkge +testnopackage pkge:none +testnopackage pkge:* + +# do not automatically change from none-arch to whatever-arch as +# this breaks other none packages and dpkg has this ruleset as +# this difference seems so important that it has to be maintained … +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s + +# pkgd has no update with an architecture +testdpkginstalled pkgd +msgtest 'Test apt-get purge' 'pkgd' +aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail +testdpkgnotinstalled pkgd + +# there is a pkgb with an architecture +testdpkginstalled pkgb +msgtest 'Test apt-get purge' 'pkgb:none' +aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail +testdpkgnotinstalled pkgb + +# check that dependencies are created after the none package exists in the cache +rm rootdir/var/cache/apt/*.bin +insertinstalledpackage 'pkgb' 'none' '1' +insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb' +insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb' +insertinstalledpackage 'pkgb' 'amd64' '2' +testequal "Reading package lists... +Building dependency tree... +Reading state information... +You might want to run 'apt-get -f install' to correct these. +The following packages have unmet dependencies: + pkgb : Conflicts: pkgb:none but 1 is installed + pkgb:none : Conflicts: pkgb but 2 is installed + pkgf:none : Conflicts: pkgb:none but 1 is installed + Conflicts: pkgb but 2 is installed + pkgg : Conflicts: pkgb but 2 is installed + Conflicts: pkgb:none but 1 is installed +E: Unmet dependencies. Try using -f." aptget check -- cgit v1.2.3-70-g09d2 From 8ec008808cd6083a633685a732dfe9b8a58a89da Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Sep 2012 21:22:54 +0200 Subject: * apt-pkg/pkgcachegen.cc: - do not create 'native' (or now 'none') package structures as a side effect of description translation parsing as it pollutes the cache --- apt-pkg/pkgcachegen.cc | 2 ++ debian/changelog | 3 +++ 2 files changed, 5 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 490c2ecbb..54b07c465 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -195,8 +195,10 @@ bool pkgCacheGenerator::MergeList(ListParser &List, string const Version = List.Version(); if (Version.empty() == true && Arch.empty() == true) { + // package descriptions if (MergeListGroup(List, PackageName) == false) return false; + continue; } if (Arch.empty() == true) diff --git a/debian/changelog b/debian/changelog index 90f3199b3..936f2557e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,9 @@ apt (0.9.7.5) UNRELEASED; urgency=low - do not warn about files which have a record in the Release file, but are not present on the CD to mirror the behavior of the other methods and to allow uncompressed indexes to be dropped without scaring users + * apt-pkg/pkgcachegen.cc: + - do not create 'native' (or now 'none') package structures as a side + effect of description translation parsing as it pollutes the cache -- David Kalnischkies Sun, 26 Aug 2012 10:49:17 +0200 -- cgit v1.2.3-70-g09d2 From 7605509f7cc97e5e94d3159f9cd5c2c98b876720 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 19 Sep 2012 11:35:53 +0200 Subject: * apt-pkg/pkgcachegen.cc: - ensure that dependencies for packages:none are always generated --- apt-pkg/pkgcachegen.cc | 2 +- debian/changelog | 8 ++++++++ .../test-bug-686346-package-missing-architecture | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 54b07c465..5f37330c9 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -922,7 +922,7 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, // Locate the target package pkgCache::PkgIterator Pkg = Grp.FindPkg(Arch); // we don't create 'none' packages and their dependencies if we can avoid it … - if (Pkg.end() == true && Arch == "none") + if (Pkg.end() == true && Arch == "none" && strcmp(Ver.ParentPkg().Arch(), "none") != 0) return true; Dynamic DynPkg(Pkg); if (Pkg.end() == true) { diff --git a/debian/changelog b/debian/changelog index 86f8579a7..5b0d049b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.9.7.6) UNRELEASED; urgency=low + + [ David Kalnischkies ] + * apt-pkg/pkgcachegen.cc: + - ensure that dependencies for packages:none are always generated + + -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 + apt (0.9.7.5) unstable; urgency=low [ Manpages translation updates ] diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index b0e0aa3c4..b2c9ec9ee 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -85,3 +85,25 @@ The following packages have unmet dependencies: pkgg : Conflicts: pkgb but 2 is installed Conflicts: pkgb:none but 1 is installed E: Unmet dependencies. Try using -f." aptget check + +# check that dependencies are generated for none-packages +rm rootdir/var/lib/dpkg/status +insertinstalledpackage 'pkgx' 'none' '1' +insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)' +insertinstalledpackage 'pkgz' 'none' '1' +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + pkgx:none* pkgy:none* +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +Purg pkgy:none [1] +Purg pkgx:none [1]' aptget purge pkgx -s +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + pkgy:none* pkgz:none* +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +Purg pkgy:none [1] +Purg pkgz:none [1]' aptget purge pkgz -s -- cgit v1.2.3-70-g09d2 From 9abb228384185565478a137446a74e42af0c95b5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 19 Sep 2012 11:39:20 +0200 Subject: add 3 missing remap registrations causing a segfault in case we use the not remapped iterators after a move of the mmap again --- apt-pkg/pkgcachegen.cc | 3 +++ debian/changelog | 2 ++ 2 files changed, 5 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5f37330c9..d5f1f9072 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -209,6 +209,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, just for these :none packages to a proper MultiArchCache, so just ensure that we have always a native package structure first for SingleArch */ pkgCache::PkgIterator NP; + Dynamic DynPkg(NP); if (NewPackage(NP, PackageName, _config->Find("APT::Architecture")) == false) // TRANSLATOR: The first placeholder is a package name, // the other two should be copied verbatim as they include debug info @@ -459,6 +460,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator map_ptrloc *OldDepLast = NULL; pkgCache::VerIterator ConVersion = D.ParentVer(); + Dynamic DynV(ConVersion); // duplicate the Conflicts/Breaks/Replaces for :none arch if (D->Version == 0) NewDepends(Pkg, ConVersion, "", 0, D->Type, OldDepLast); @@ -772,6 +774,7 @@ unsigned long pkgCacheGenerator::NewVersion(pkgCache::VerIterator &Ver, // Fill it in Ver = pkgCache::VerIterator(Cache,Cache.VerP + Version); + Dynamic DynV(Ver); Ver->NextVer = Next; Ver->ID = Cache.HeaderP->VersionCount++; map_ptrloc const idxVerStr = WriteStringInMap(VerStr); diff --git a/debian/changelog b/debian/changelog index 5b0d049b7..b7f8e2045 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ apt (0.9.7.6) UNRELEASED; urgency=low [ David Kalnischkies ] * apt-pkg/pkgcachegen.cc: - ensure that dependencies for packages:none are always generated + - add 3 missing remap registrations causing a segfault in case + we use the not remapped iterators after a move of the mmap again -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 -- cgit v1.2.3-70-g09d2 From 021626db10191cc4388b0516687dbc51bba18820 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 19 Sep 2012 12:04:02 +0200 Subject: * apt-pkg/pkgcache.cc: - ignore negative dependencies applying in the same group for M-A:same packages on the real package name as self-conflicts --- apt-pkg/depcache.cc | 2 +- apt-pkg/pkgcache.cc | 25 ++++++++++- debian/changelog | 3 ++ .../integration/test-conflicts-real-multiarch-same | 50 ++++++++++++++++++++++ 4 files changed, 77 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-conflicts-real-multiarch-same (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 2656e9b42..deb8ec21f 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -346,7 +346,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res) /* Check simple depends. A depends -should- never self match but we allow it anyhow because dpkg does. Technically it is a packaging bug. Conflicts may never self match */ - if (Dep.TargetPkg() != Dep.ParentPkg() || Dep.IsNegative() == false) + if (Dep.IsIgnorable(Res) == false) { PkgIterator Pkg = Dep.TargetPkg(); // Check the base package diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 353172d8a..1de33ff9b 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -690,8 +690,29 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End) on virtual packages. */ bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &Pkg) const { - if (ParentPkg() == TargetPkg()) - return IsNegative(); + if (IsNegative() == false) + return false; + + pkgCache::PkgIterator PP = ParentPkg(); + pkgCache::PkgIterator PT = TargetPkg(); + if (PP->Group != PT->Group) + return false; + // self-conflict + if (PP == PT) + return true; + pkgCache::VerIterator PV = ParentVer(); + // ignore group-conflict on a M-A:same package - but not our implicit dependencies + // so that we can have M-A:same packages conflicting with their own real name + if ((PV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) + { + // Replaces: ${self}:other ( << ${binary:Version}) + if (S->Type == pkgCache::Dep::Replaces && S->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) + return false; + // Breaks: ${self}:other (!= ${binary:Version}) + if (S->Type == pkgCache::Dep::DpkgBreaks && S->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) + return false; + return true; + } return false; } diff --git a/debian/changelog b/debian/changelog index b7f8e2045..4389f4090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ apt (0.9.7.6) UNRELEASED; urgency=low - ensure that dependencies for packages:none are always generated - add 3 missing remap registrations causing a segfault in case we use the not remapped iterators after a move of the mmap again + * apt-pkg/pkgcache.cc: + - ignore negative dependencies applying in the same group for + M-A:same packages on the real package name as self-conflicts -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 diff --git a/test/integration/test-conflicts-real-multiarch-same b/test/integration/test-conflicts-real-multiarch-same new file mode 100755 index 000000000..d9111677c --- /dev/null +++ b/test/integration/test-conflicts-real-multiarch-same @@ -0,0 +1,50 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'virtual-provider' 'amd64,i386' '2' 'Provides: virtual +Conflicts: virtual +Multi-Arch: same' +insertpackage 'unstable' 'real' 'amd64,i386' '2' 'Conflicts: real +Multi-Arch: same' +insertpackage 'unstable' 'real-provider' 'amd64,i386' '2' 'Provides: real-provider +Conflicts: real-provider +Multi-Arch: same' +setupaptarchive + +testequal "Reading package lists... +Building dependency tree... +Note, selecting 'virtual-provider' instead of 'virtual' +Note, selecting 'virtual-provider:i386' instead of 'virtual:i386' +The following NEW packages will be installed: + virtual-provider virtual-provider:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst virtual-provider (2 unstable [amd64]) +Inst virtual-provider:i386 (2 unstable [i386]) +Conf virtual-provider (2 unstable [amd64]) +Conf virtual-provider:i386 (2 unstable [i386])" aptget install virtual:* -s -q=0 + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + real real:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst real (2 unstable [amd64]) +Inst real:i386 (2 unstable [i386]) +Conf real (2 unstable [amd64]) +Conf real:i386 (2 unstable [i386])' aptget install real:* -s -q=0 + +# ensure that we are not confused by the provides +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + real-provider real-provider:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst real-provider (2 unstable [amd64]) +Inst real-provider:i386 (2 unstable [i386]) +Conf real-provider (2 unstable [amd64]) +Conf real-provider:i386 (2 unstable [i386])' aptget install real-provider:* -s -q=0 -- cgit v1.2.3-70-g09d2 From dfe45e1f1133ffabe55297ae76c77a0767e3ae55 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 09:59:54 +0200 Subject: correct "3 missing" to "2 missing" remap registrations as the Version handled in NewVersion is already registered --- apt-pkg/pkgcachegen.cc | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index d5f1f9072..4eaf40b51 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -774,7 +774,7 @@ unsigned long pkgCacheGenerator::NewVersion(pkgCache::VerIterator &Ver, // Fill it in Ver = pkgCache::VerIterator(Cache,Cache.VerP + Version); - Dynamic DynV(Ver); + //Dynamic DynV(Ver); // caller MergeListVersion already takes care of it Ver->NextVer = Next; Ver->ID = Cache.HeaderP->VersionCount++; map_ptrloc const idxVerStr = WriteStringInMap(VerStr); diff --git a/debian/changelog b/debian/changelog index c06435102..307bd1eee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,7 @@ apt (0.9.7.6) UNRELEASED; urgency=low [ David Kalnischkies ] * apt-pkg/pkgcachegen.cc: - ensure that dependencies for packages:none are always generated - - add 3 missing remap registrations causing a segfault in case + - add 2 missing remap registrations causing a segfault in case we use the not remapped iterators after a move of the mmap again * apt-pkg/pkgcache.cc: - ignore negative dependencies applying in the same group for -- cgit v1.2.3-70-g09d2 From 7ccb5efb4f5b4471e6b424377f42feff070bb2d3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 11:16:30 +0200 Subject: write the native architecture as unique string into the cache header as it is used for arch:all packages as a map to arch:native. Otherwise arch comparisons later will see differences (Closes: #689323) --- apt-pkg/pkgcachegen.cc | 4 +++- debian/changelog | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 4eaf40b51..739b538c6 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -69,7 +69,9 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) : *Cache.HeaderP = pkgCache::Header(); map_ptrloc const idxVerSysName = WriteStringInMap(_system->VS->Label); Cache.HeaderP->VerSysName = idxVerSysName; - map_ptrloc const idxArchitecture = WriteStringInMap(_config->Find("APT::Architecture")); + // this pointer is set in ReMap, but we need it now for WriteUniqString + Cache.StringItemP = (pkgCache::StringItem *)Map.Data(); + map_ptrloc const idxArchitecture = WriteUniqString(_config->Find("APT::Architecture")); Cache.HeaderP->Architecture = idxArchitecture; if (unlikely(idxVerSysName == 0 || idxArchitecture == 0)) return; diff --git a/debian/changelog b/debian/changelog index 307bd1eee..c1936a865 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ apt (0.9.7.6) UNRELEASED; urgency=low - ensure that dependencies for packages:none are always generated - add 2 missing remap registrations causing a segfault in case we use the not remapped iterators after a move of the mmap again + - write the native architecture as unique string into the cache header + as it is used for arch:all packages as a map to arch:native. + Otherwise arch comparisons later will see differences (Closes: #689323) * apt-pkg/pkgcache.cc: - ignore negative dependencies applying in the same group for M-A:same packages on the real package name as self-conflicts -- cgit v1.2.3-70-g09d2 From 036eb0127ac3339347eb39c805e98fe43905bafe Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 12:14:44 +0200 Subject: * apt-pkg/edsp.cc: - include reinstall requests and already installed (= protected) packages in the install-request for external resolvers (Closes: #689331) --- apt-pkg/edsp.cc | 6 ++++-- debian/changelog | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index adb8788b3..6ce9da784 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -214,9 +214,11 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade, if (Progress != NULL && p % 100 == 0) Progress->Progress(p); string* req; - if (Cache[Pkg].Delete() == true) + pkgDepCache::StateCache &P = Cache[Pkg]; + if (P.Delete() == true) req = &del; - else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true) + else if (P.NewInstall() == true || P.Upgrade() == true || P.ReInstall() == true || + (P.Mode == pkgDepCache::ModeKeep && (P.iFlags & pkgDepCache::Protected) == pkgDepCache::Protected)) req = &inst; else continue; diff --git a/debian/changelog b/debian/changelog index c1936a865..545791f34 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,9 @@ apt (0.9.7.6) UNRELEASED; urgency=low APT::Cache::ShowVersion is true (default: false) as discussed in #218995 to help debian-cd fixing #687949. Thanks to Sam Lidder for initial patch and Steve McIntyre for nagging and testing! + * apt-pkg/edsp.cc: + - include reinstall requests and already installed (= protected) packages + in the install-request for external resolvers (Closes: #689331) -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 -- cgit v1.2.3-70-g09d2 From 9ed80cdd1faceb32963393449bc94a5d93a9115f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 13:18:29 +0200 Subject: * apt-pkg/policy.cc: - match pins with(out) an architecture as we do on the commandline (partly fixing #687255, b= support has to wait for jessie) --- apt-pkg/policy.cc | 49 ++++++++++++++++++++++++++----------------------- debian/changelog | 3 +++ 2 files changed, 29 insertions(+), 23 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index b47dab90c..4ae3b5f87 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -259,17 +260,33 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, } // 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(); + pkgCache::GrpIterator Grp = Cache->FindGrp(Name); + bool matched = false; + if (Grp.end() == false) + { + std::string MatchingArch; + if (Arch.empty() == true) + MatchingArch = Cache->NativeArch(); + else + MatchingArch = Arch; + APT::CacheFilter::PackageArchitectureMatchesSpecification pams(MatchingArch); + for (pkgCache::PkgIterator Pkg = Grp.PackageList(); Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) + { + if (pams(Pkg.Arch()) == false) + continue; + 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; + matched = true; + } } - if (Pkg.end() == true) + if (matched == false) { PkgPin *P = &*Unmatched.insert(Unmatched.end(),PkgPin(Name)); if (Arch.empty() == false) @@ -279,20 +296,6 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Data = Data; return; } - - for (; Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) - { - 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; - if (Grp.end() == true) - break; - } } /*}}}*/ // Policy::GetMatch - Get the matching version for a package pin /*{{{*/ diff --git a/debian/changelog b/debian/changelog index 545791f34..09d818e20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,9 @@ apt (0.9.7.6) UNRELEASED; urgency=low * apt-pkg/edsp.cc: - include reinstall requests and already installed (= protected) packages in the install-request for external resolvers (Closes: #689331) + * apt-pkg/policy.cc: + - match pins with(out) an architecture as we do on the commandline + (partly fixing #687255, b= support has to wait for jessie) -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 -- cgit v1.2.3-70-g09d2 From b8c50bd0415bd4ea16a8f09356d882f267976d40 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 17:25:07 +0200 Subject: * apt-pkg/contrib/netrc.cc: - remove the 64 char limit for login/password in internal usage --- apt-pkg/contrib/netrc.cc | 43 +++++++++++++++++++++++++++---------------- debian/changelog | 2 ++ 2 files changed, 29 insertions(+), 16 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 56e59d84b..950d21dad 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -44,11 +44,11 @@ enum { #define NETRC DOT_CHAR "netrc" /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ -int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) +static int parsenetrc_string (char *host, std::string &login, std::string &password, char *netrcfile = NULL) { FILE *file; int retcode = 1; - int specific_login = (login[0] != 0); + int specific_login = (login.empty() == false); char *home = NULL; bool netrc_alloc = false; @@ -88,7 +88,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) { tok = strtok_r (netrcbuffer, " \t\n", &tok_buf); while (!done && tok) { - if(login[0] && password[0]) { + if(login.empty() == false && password.empty() == false) { done = true; break; } @@ -120,13 +120,13 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) /* we are now parsing sub-keywords concerning "our" host */ if (state_login) { if (specific_login) - state_our_login = !strcasecmp (login, tok); + state_our_login = !strcasecmp (login.c_str(), tok); else - strncpy (login, tok, LOGINSIZE - 1); + login = tok; state_login = 0; } else if (state_password) { if (state_our_login || !specific_login) - strncpy (password, tok, PASSWORDSIZE - 1); + password = tok; state_password = 0; } else if (!strcasecmp ("login", tok)) state_login = 1; @@ -152,6 +152,18 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) return retcode; } +// for some unknown reason this method is exported so keep a compatible interface for now … +int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) +{ + std::string login_string, password_string; + int const ret = parsenetrc_string(host, login_string, password_string, netrcfile); + if (ret < 0) + return ret; + strncpy(login, login_string.c_str(), LOGINSIZE - 1); + strncpy(password, password_string.c_str(), PASSWORDSIZE - 1); + return ret; +} + void maybe_add_auth (URI &Uri, string NetRCFile) { @@ -162,21 +174,20 @@ void maybe_add_auth (URI &Uri, string NetRCFile) { if (NetRCFile.empty () == false) { - char login[64] = ""; - char password[64] = ""; + std::string login, password; char *netrcfile = strdup(NetRCFile.c_str()); // first check for a generic host based netrc entry char *host = strdup(Uri.Host.c_str()); - if (host && parsenetrc (host, login, password, netrcfile) == 0) + if (host && parsenetrc_string(host, login, password, netrcfile) == 0) { if (_config->FindB("Debug::Acquire::netrc", false) == true) std::clog << "host: " << host << " user: " << login - << " pass-size: " << strlen(password) + << " pass-size: " << password.size() << std::endl; - Uri.User = string (login); - Uri.Password = string (password); + Uri.User = login; + Uri.Password = password; free(netrcfile); free(host); return; @@ -187,15 +198,15 @@ void maybe_add_auth (URI &Uri, string NetRCFile) // a lookup uri.startswith(host) in the netrc file parser (because // of the "/" char *hostpath = strdup(string(Uri.Host+Uri.Path).c_str()); - if (hostpath && parsenetrc (hostpath, login, password, netrcfile) == 0) + if (hostpath && parsenetrc_string(hostpath, login, password, netrcfile) == 0) { if (_config->FindB("Debug::Acquire::netrc", false) == true) std::clog << "hostpath: " << hostpath << " user: " << login - << " pass-size: " << strlen(password) + << " pass-size: " << password.size() << std::endl; - Uri.User = string (login); - Uri.Password = string (password); + Uri.User = login; + Uri.Password = password; } free(netrcfile); free(hostpath); diff --git a/debian/changelog b/debian/changelog index 8c1508c3f..4156b6093 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ apt (0.9.7.6) UNRELEASED; urgency=low * apt-pkg/policy.cc: - match pins with(out) an architecture as we do on the commandline (partly fixing #687255, b= support has to wait for jessie) + * apt-pkg/contrib/netrc.cc: + - remove the 64 char limit for login/password in internal usage -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 -- cgit v1.2.3-70-g09d2 From 7f18595b3ef9a348719969889097adb4f45d44f0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Oct 2012 18:56:23 +0200 Subject: remove 256 char line limit by using getline() (POSIX.1-2008) --- apt-pkg/contrib/netrc.cc | 8 +++++--- debian/changelog | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 950d21dad..c5f9630c4 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -79,13 +79,14 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw char *tok; char *tok_buf; bool done = false; - char netrcbuffer[256]; + char *netrcbuffer = NULL; + size_t netrcbuffer_size = 0; int state = NOTHING; char state_login = 0; /* Found a login keyword */ char state_password = 0; /* Found a password keyword */ - while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) { + while (!done && getline(&netrcbuffer, &netrcbuffer_size, file) != -1) { tok = strtok_r (netrcbuffer, " \t\n", &tok_buf); while (!done && tok) { if(login.empty() == false && password.empty() == false) { @@ -142,8 +143,9 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw tok = strtok_r (NULL, " \t\n", &tok_buf); } /* while(tok) */ - } /* while fgets() */ + } /* while getline() */ + free(netrcbuffer); fclose(file); } diff --git a/debian/changelog b/debian/changelog index 4156b6093..28c064468 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,7 @@ apt (0.9.7.6) UNRELEASED; urgency=low (partly fixing #687255, b= support has to wait for jessie) * apt-pkg/contrib/netrc.cc: - remove the 64 char limit for login/password in internal usage + - remove 256 char line limit by using getline() (POSIX.1-2008) -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 -- cgit v1.2.3-70-g09d2 From 27cae7715489c13c504590cf77a6d22680dbe0b1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 15 Oct 2012 16:00:44 +0200 Subject: * apt-pkg/pkgcachegen.cc: - Fix crash if the cache is remapped while writing a Provides version (LP: #1066445). --- apt-pkg/pkgcachegen.cc | 8 ++++++-- debian/changelog | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 739b538c6..373f6625c 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -975,8 +975,12 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, Prv->Version = Ver.Index(); Prv->NextPkgProv = Ver->ProvidesList; Ver->ProvidesList = Prv.Index(); - if (Version.empty() == false && unlikely((Prv->ProvideVersion = WriteString(Version)) == 0)) - return false; + if (Version.empty() == false) { + map_ptrloc const idxProvideVersion = WriteString(Version); + Prv->ProvideVersion = idxProvideVersion; + if (unlikely(idxProvideVersion == 0)) + return false; + } // Locate the target package pkgCache::PkgIterator Pkg; diff --git a/debian/changelog b/debian/changelog index 1fd2e8936..f83d661a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,11 @@ apt (0.9.7.6) UNRELEASED; urgency=low * increase the maximum netrc login/password size and show proper error message on overflow + [ Colin Watson ] + * apt-pkg/pkgcachegen.cc: + - Fix crash if the cache is remapped while writing a Provides version + (LP: #1066445). + -- David Kalnischkies Wed, 19 Sep 2012 11:29:56 +0200 apt (0.9.7.5) unstable; urgency=low -- cgit v1.2.3-70-g09d2