From 67b5d3dc34e88e092c8e5f05efc82370a873c80f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 12:40:38 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - redirect out/input of dpkg --assert-multi-arch to /dev/null --- apt-pkg/deb/dpkgpm.cc | 5 +++++ debian/changelog | 8 ++++++++ test/integration/test-dpkg-assert-multi-arch | 12 ++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 4dc0baa50..0dc00e8ad 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -858,6 +858,11 @@ bool pkgDPkgPM::Go(int OutStatusFd) pid_t dpkgAssertMultiArch = ExecFork(); if (dpkgAssertMultiArch == 0) { + // redirect everything to the ultimate sink as we only need the exit-status + int const nullfd = open("/dev/null", O_RDONLY); + dup2(nullfd, STDIN_FILENO); + dup2(nullfd, STDOUT_FILENO); + dup2(nullfd, STDERR_FILENO); execv(Args[0], (char**) &Args[0]); _error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!"); _exit(2); diff --git a/debian/changelog b/debian/changelog index ef25344ca..6ed7cb73e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.8.16~exp11) experimental; urgency=low + + [ David Kalnischkies ] + * apt-pkg/deb/dpkgpm.cc: + - redirect out/input of dpkg --assert-multi-arch to /dev/null + + -- David Kalnischkies Thu, 19 Jan 2012 12:39:31 +0100 + apt (0.8.16~exp10) experimental; urgency=low [ David Kalnischkies ] diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index b1ec73e18..8be7e0d76 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -14,14 +14,22 @@ setupaptarchive testqualifier() { msgtest 'Test for correct qualifier mode' $2 - GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -- '--configure' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" - test "$GIVEN" = "$2" && msgpass || msgfail + GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" + if [ "$GIVEN" = "$2" ]; then + msgpass + else + echo + echo "$GIVEN" + msgfail + fi } # non-multiarch or "ubuntus" old multiarchified dpkg echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper echo '#! /bin/sh if echo "$*" | grep -q -- "--assert-multi-arch"; then + echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch' + echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch' return 2; fi return $*' > ./dpkg-wrapper -- cgit v1.2.3 From 3a5ec3053c00ff5db058f1ddd99bf23591b9a181 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 13:12:14 +0100 Subject: if multi-arch is detected ensure that pkg:all is reported as pkg:all Versions with arch:all are added to the package with the native arch, so we can't rely on Pkg.Arch() for the architecture --- apt-pkg/deb/dpkgpm.cc | 5 ++++- debian/changelog | 3 ++- test/integration/test-dpkg-assert-multi-arch | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 0dc00e8ad..6feada4cc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1090,7 +1090,10 @@ bool pkgDPkgPM::Go(int OutStatusFd) } else { - char * const fullname = strdup(I->Pkg.FullName(false).c_str()); + std::string name = I->Pkg.Name(); + pkgCache::VerIterator PkgVer = Cache[I->Pkg].InstVerIter(Cache); + name.append(":").append(PkgVer.Arch()); + char * const fullname = strdup(name.c_str()); Packages.push_back(fullname); ADDARG(fullname); } diff --git a/debian/changelog b/debian/changelog index 6ed7cb73e..10356cde8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ apt (0.8.16~exp11) experimental; urgency=low [ David Kalnischkies ] * apt-pkg/deb/dpkgpm.cc: - redirect out/input of dpkg --assert-multi-arch to /dev/null + - if multi-arch is detected ensure that pkg:all is reported as pkg:all - -- David Kalnischkies Thu, 19 Jan 2012 12:39:31 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 13:00:13 +0100 apt (0.8.16~exp10) experimental; urgency=low diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index 8be7e0d76..532cfd26a 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -9,6 +9,8 @@ configarchitecture 'amd64' 'i386' buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' +buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' setupaptarchive @@ -42,9 +44,21 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' testqualifier 'same-lib' 'same-lib' testqualifier 'same-lib:amd64' 'same-lib' testqualifier 'same-lib:i386' 'same-lib:i386' +testqualifier 'all-pkg' 'all-pkg' +testqualifier 'all-pkg:amd64' 'all-pkg' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'all-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +testqualifier 'all-pkg' 'all-pkg' +testqualifier 'all-pkg:amd64' 'all-pkg' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' # multiarch dpkg (new interface version) +rm rootdir/var/lib/dpkg/status +touch rootdir/var/lib/dpkg/status echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper echo '#! /bin/sh if echo "$*" | grep -q -- "--assert-multi-arch"; then @@ -59,3 +73,13 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' testqualifier 'same-lib' 'same-lib:amd64' testqualifier 'same-lib:amd64' 'same-lib:amd64' testqualifier 'same-lib:i386' 'same-lib:i386' +testqualifier 'all-pkg' 'all-pkg:all' +testqualifier 'all-pkg:amd64' 'all-pkg:all' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'all-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +testqualifier 'all-pkg' 'all-pkg:all' +testqualifier 'all-pkg:amd64' 'all-pkg:all' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' -- cgit v1.2.3 From 8737e3dca39af0d8758677fc1884b5720124f96b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Jan 2012 14:12:12 +0100 Subject: releasing version 0.8.16~exp11 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 10356cde8..bf23ec1eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,7 @@ apt (0.8.16~exp11) experimental; urgency=low - redirect out/input of dpkg --assert-multi-arch to /dev/null - if multi-arch is detected ensure that pkg:all is reported as pkg:all - -- David Kalnischkies Thu, 19 Jan 2012 13:00:13 +0100 + -- Michael Vogt Thu, 19 Jan 2012 13:48:18 +0100 apt (0.8.16~exp10) experimental; urgency=low -- cgit v1.2.3 From 7720666fba9cd7024009bed964ccfa3f2be97c59 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Jan 2012 16:28:20 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - fix segfault on pkg removal --- apt-pkg/deb/dpkgpm.cc | 6 +++++- debian/changelog | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 6feada4cc..99c28d201 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1090,8 +1090,12 @@ bool pkgDPkgPM::Go(int OutStatusFd) } else { + pkgCache::VerIterator PkgVer; std::string name = I->Pkg.Name(); - pkgCache::VerIterator PkgVer = Cache[I->Pkg].InstVerIter(Cache); + if (Op == Item::Remove || Op == Item::Purge) + PkgVer = I->Pkg.CurrentVer(); + else + PkgVer = Cache[I->Pkg].InstVerIter(Cache); name.append(":").append(PkgVer.Arch()); char * const fullname = strdup(name.c_str()); Packages.push_back(fullname); diff --git a/debian/changelog b/debian/changelog index bf23ec1eb..d8316abf6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.8.16~exp12) experimental; urgency=low + + [ Michael Vogt ] + * apt-pkg/deb/dpkgpm.cc: + - fix segfault on pkg removal + + -- Michael Vogt Thu, 19 Jan 2012 16:28:03 +0100 + apt (0.8.16~exp11) experimental; urgency=low [ David Kalnischkies ] -- cgit v1.2.3 From 2a2a7ef4dfa9d8fb8118c2e318555438098cdf34 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 18:42:57 +0100 Subject: * apt-pkg/cacheiterators.h: - return the correct version arch for all+foreign, too The flag is interpreted at a few other places in different styles so this commit ensures that the flag check is consistent everywhere (checking for Same in flag style is a bit too much as it isn't used in combination with others anyway, but who knows and just for consistency) --- apt-pkg/cacheiterators.h | 2 +- apt-pkg/deb/dpkgpm.cc | 4 ++-- apt-pkg/packagemanager.cc | 2 +- cmdline/apt-get.cc | 4 ++-- debian/changelog | 6 +++++- test/integration/framework | 9 ++++++++- test/integration/test-dpkg-assert-multi-arch | 22 +++++++++++++++++----- 7 files changed, 36 insertions(+), 13 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index e6a0fddb0..d5e018be9 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -207,7 +207,7 @@ class pkgCache::VerIterator : public Iterator { inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}; inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}; inline const char *Arch() const { - if (S->MultiArch == pkgCache::Version::All) + if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All) return "all"; return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch; }; diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 99c28d201..2b04f0e71 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1093,9 +1093,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) pkgCache::VerIterator PkgVer; std::string name = I->Pkg.Name(); if (Op == Item::Remove || Op == Item::Purge) - PkgVer = I->Pkg.CurrentVer(); + PkgVer = I->Pkg.CurrentVer(); else - PkgVer = Cache[I->Pkg].InstVerIter(Cache); + PkgVer = Cache[I->Pkg].InstVerIter(Cache); name.append(":").append(PkgVer.Arch()); char * const fullname = strdup(name.c_str()); Packages.push_back(fullname); diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index c9d7a3024..349adbe40 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -733,7 +733,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States); - if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same) + if (Immediate == true && (instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) { /* Do lockstep M-A:same unpacking in two phases: First unpack all installed architectures, then the not installed. diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ca1169401..85ae1cd7e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2872,12 +2872,12 @@ bool DoBuildDep(CommandLine &CmdL) forbidden = "Multi-Arch: same"; // :native gets the buildArch } - else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign) + else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) { if (colon != string::npos) forbidden = "Multi-Arch: foreign"; } - else if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed) + else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) { if (colon == string::npos) Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); diff --git a/debian/changelog b/debian/changelog index d8316abf6..838b14ef1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,11 @@ apt (0.8.16~exp12) experimental; urgency=low * apt-pkg/deb/dpkgpm.cc: - fix segfault on pkg removal - -- Michael Vogt Thu, 19 Jan 2012 16:28:03 +0100 + [ David Kalnischkies ] + * apt-pkg/cacheiterators.h: + - return the correct version arch for all+foreign, too + + -- David Kalnischkies Thu, 19 Jan 2012 18:38:33 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/test/integration/framework b/test/integration/framework index 2ea1844f0..d7526a100 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -25,7 +25,14 @@ msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; } msgnmsg() { echo -n "${CMSG}$1${CNORMAL}" >&2; } msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}" >&2; } msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}" >&2; } -msgtest() { echo -n "${CINFO}$1 ${CCMD}$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} …${CNORMAL} " >&2; } +msgtest() { + while [ -n "$1" ]; do + echo -n "${CINFO}$1${CCMD} " >&2; + echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2; + shift 2 + done + echo -n "…${CNORMAL} " >&2; +} msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; } diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index 532cfd26a..177d7489b 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -10,13 +10,13 @@ buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' -buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' +buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign' setupaptarchive testqualifier() { - msgtest 'Test for correct qualifier mode' $2 - GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" + msgtest 'Test with' $1 'for correct qualifier mode' $2 + GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -v -- '--unpack' | sed -e 's/^.*--[^u][^ ]* \([^ ]*\).*$/\1/')" if [ "$GIVEN" = "$2" ]; then msgpass else @@ -49,11 +49,17 @@ testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg' testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg' +testqualifier 'always-all-pkg-' 'always-all-pkg' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg' # multiarch dpkg (new interface version) @@ -78,8 +84,14 @@ testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg:all' testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg:amd64' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64' +testqualifier 'always-all-pkg-' 'always-all-pkg:all' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all' -- cgit v1.2.3 From 3e9ab9f0a81155df6a5b734bb5d079800ccd5514 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 22:48:27 +0100 Subject: * apt-pkg/packagemanager.cc: - ignore breaks on not-installed versions while searching for breakage loops as we don't have to avoid them --- apt-pkg/packagemanager.cc | 8 +++++++- debian/changelog | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 349adbe40..dd08a48ad 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -682,7 +682,13 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c VerIterator Ver(Cache,*I); PkgIterator BrokenPkg = Ver.ParentPkg(); VerIterator InstallVer(Cache,Cache[BrokenPkg].InstallVer); - + if (BrokenPkg.CurrentVer() != Ver) + { + if (Debug) + std::clog << OutputInDepth(Depth) << " Ignore not-installed version " << Ver.VerStr() << " of " << Pkg.FullName() << " for " << End << std::endl; + continue; + } + // Check if it needs to be unpacked if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false && List->IsNow(BrokenPkg)) { diff --git a/debian/changelog b/debian/changelog index 838b14ef1..f846663e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,11 @@ apt (0.8.16~exp12) experimental; urgency=low [ David Kalnischkies ] * apt-pkg/cacheiterators.h: - return the correct version arch for all+foreign, too + * apt-pkg/packagemanager.cc: + - ignore breaks on not-installed versions while searching for + breakage loops as we don't have to avoid them - -- David Kalnischkies Thu, 19 Jan 2012 18:38:33 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 22:46:38 +0100 apt (0.8.16~exp11) experimental; urgency=low -- cgit v1.2.3 From e49c90b355547db33bb01229e10ca99a19652003 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 23:15:29 +0100 Subject: * debian/control: - remove APT from the short descriptions as lintian doesn't like it and it doesn't transport any information for a reader anyway --- debian/changelog | 5 ++++- debian/control | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index f846663e2..eb49bd84e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,11 @@ apt (0.8.16~exp12) experimental; urgency=low * apt-pkg/packagemanager.cc: - ignore breaks on not-installed versions while searching for breakage loops as we don't have to avoid them + * debian/control: + - remove APT from the short descriptions as lintian doesn't like it + and it doesn't transport any information for a reader anyway - -- David Kalnischkies Thu, 19 Jan 2012 22:46:38 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 23:14:28 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/debian/control b/debian/control index 03d74c51f..20991adb3 100644 --- a/debian/control +++ b/debian/control @@ -7,8 +7,8 @@ Uploaders: Michael Vogt , Otavio Salvador , Julian Andres Klode Standards-Version: 3.9.2 Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev, - gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), - zlib1g-dev | libz-dev, debiandoc-sgml, xsltproc, docbook-xsl, docbook-xml, + gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), + zlib1g-dev | libz-dev, debiandoc-sgml, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen Build-Conflicts: autoconf2.13, automake1.4 Vcs-Bzr: http://bzr.debian.org/apt/debian-sid/ @@ -20,7 +20,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, debian-archive-keyring, gnupg Replaces: manpages-pl (<< 20060617-3~) Conflicts: python-apt (<< 0.7.93.2~) Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt -Description: APT's commandline package manager +Description: commandline package manager This package provides commandline tools for searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. @@ -40,7 +40,7 @@ Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} -Description: APT's package managment runtime library +Description: package managment runtime library This library provides the common functionality for searching and managing packages as well as information about packages. Higher-level package managers can depend upon this library. @@ -61,8 +61,8 @@ Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} -Description: APT's deb package format runtime library - This library provides methods to query and extract information +Description: deb package format runtime library + This library provides methods to query and extract information from deb packages. This includes the control data and the package file content. @@ -71,7 +71,7 @@ Architecture: all Priority: optional Depends: ${misc:Depends} Section: doc -Description: Documentation for APT +Description: documentation for APT This package contains the user guide and offline guide for various APT tools which are provided in a html and a text-only version. @@ -82,7 +82,7 @@ Priority: optional Pre-Depends: ${misc:Pre-Depends} Depends: ${libapt-pkg-name} (= ${binary:Version}), ${libapt-inst-name} (= ${binary:Version}), ${misc:Depends}, zlib1g-dev | zlib-dev Section: libdevel -Description: Development files for APT's libapt-pkg and libapt-inst +Description: development files for APT's libapt-pkg and libapt-inst This package contains the header files and libraries for developing with APT's libapt-pkg Debian package manipulation library and the libapt-inst deb/tar/ar library. @@ -92,7 +92,7 @@ Architecture: all Priority: optional Depends: ${misc:Depends} Section: doc -Description: Documentation for APT development +Description: documentation for APT development This package contains documentation for development of the APT Debian package manipulation program and its libraries. . @@ -102,7 +102,7 @@ Description: Documentation for APT development Package: apt-utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: APT utility programs +Description: package managment related utility programs This package contains some less used commandline utilities related to package managment with APT. . -- cgit v1.2.3 From e537945222090f00f2811b0fa1a0a3a5b3d7d3f8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 23:20:45 +0100 Subject: * debian/rules: - apply patch to enable usage of hardning CPPFLAGS and LDFLAGS by Moritz Muehlenhoff, thanks! (Closes: #653504) --- debian/changelog | 5 ++++- debian/rules | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index eb49bd84e..4926bbdc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,11 @@ apt (0.8.16~exp12) experimental; urgency=low * debian/control: - remove APT from the short descriptions as lintian doesn't like it and it doesn't transport any information for a reader anyway + * debian/rules: + - apply patch to enable usage of hardning CPPFLAGS and LDFLAGS by + Moritz Muehlenhoff, thanks! (Closes: #653504) - -- David Kalnischkies Thu, 19 Jan 2012 23:14:28 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 23:18:12 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/debian/rules b/debian/rules index 4ef5bb47a..9eda3a8fa 100755 --- a/debian/rules +++ b/debian/rules @@ -19,6 +19,8 @@ endif ifneq (,$(shell which dpkg-buildflags)) export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) + export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) + export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) else ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) export CXXFLAGS = -O0 -g -Wall @@ -92,7 +94,7 @@ build/configure-stamp: configure dh_testdir -mkdir build cp COPYING debian/copyright - cd build && CXXFLAGS="$(CXXFLAGS)" ../configure $(confflags) + cd build && CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" ../configure $(confflags) touch $@ build/build-stamp: build/configure-stamp -- cgit v1.2.3 From d542b1464ac4667672c8ee7f3fda11c34dcc16a6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 23:25:39 +0100 Subject: apply typofixes by Pascal De Vuyst, thanks! (Closes: #652834, #652835) --- debian/changelog | 3 ++- debian/control | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4926bbdc8..7f5de05e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,11 +13,12 @@ apt (0.8.16~exp12) experimental; urgency=low * debian/control: - remove APT from the short descriptions as lintian doesn't like it and it doesn't transport any information for a reader anyway + - apply typofixes by Pascal De Vuyst, thanks! (Closes: #652834, #652835) * debian/rules: - apply patch to enable usage of hardning CPPFLAGS and LDFLAGS by Moritz Muehlenhoff, thanks! (Closes: #653504) - -- David Kalnischkies Thu, 19 Jan 2012 23:18:12 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 23:23:29 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/debian/control b/debian/control index 20991adb3..311346b0f 100644 --- a/debian/control +++ b/debian/control @@ -120,7 +120,7 @@ Description: https download transport for APT This package enables the usage of 'deb https://foo distro main' lines in the /etc/apt/sources.list so that all package managers using the libapt-pkg library can access metadata and packages available in sources - accessable over https (Hypertext Transfer Protocol Secure). + accessible over https (Hypertext Transfer Protocol Secure). . - This transport supports server as well as client authenification + This transport supports server as well as client authentication with certificates. -- cgit v1.2.3 From 8654fae974db3351bbb324449cf8c0f67d690bae Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 23:51:00 +0100 Subject: * methods/https.cc: - use curls list append instead of appending Range and If-Range by hand which generates malformed requests, thanks Mel Collins for the hint! (Closes: #646381) --- debian/changelog | 6 +++++- methods/https.cc | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7f5de05e0..299afcf54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,12 @@ apt (0.8.16~exp12) experimental; urgency=low * debian/rules: - apply patch to enable usage of hardning CPPFLAGS and LDFLAGS by Moritz Muehlenhoff, thanks! (Closes: #653504) + * methods/https.cc: + - use curls list append instead of appending Range and If-Range by hand + which generates malformed requests, thanks Mel Collins for the hint! + (Closes: #646381) - -- David Kalnischkies Thu, 19 Jan 2012 23:23:29 +0100 + -- David Kalnischkies Thu, 19 Jan 2012 23:43:03 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/methods/https.cc b/methods/https.cc index 317c8a587..6de18b8e0 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -100,7 +100,6 @@ void HttpsMethod::SetupProxy() /*{{{*/ depth. */ bool HttpsMethod::Fetch(FetchItem *Itm) { - stringstream ss; struct stat SBuf; struct curl_slist *headers=NULL; char curl_errorstr[CURL_ERROR_SIZE]; @@ -199,6 +198,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) if (_config->FindB("Acquire::https::No-Store", _config->FindB("Acquire::http::No-Store",false)) == true) headers = curl_slist_append(headers,"Cache-Control: no-store"); + stringstream ss; ioprintf(ss, "Cache-Control: max-age=%u", _config->FindI("Acquire::https::Max-Age", _config->FindI("Acquire::http::Max-Age",0))); headers = curl_slist_append(headers, ss.str().c_str()); @@ -246,11 +246,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm) if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0) { char Buf[1000]; - sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n", - (long)SBuf.st_size - 1, - TimeRFC1123(SBuf.st_mtime).c_str()); + sprintf(Buf, "Range: bytes=%li-", (long) SBuf.st_size - 1); headers = curl_slist_append(headers, Buf); - } + sprintf(Buf, "If-Range: %s", TimeRFC1123(SBuf.st_mtime).c_str()); + headers = curl_slist_append(headers, Buf); + } else if(Itm->LastModified > 0) { curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); -- cgit v1.2.3 From 38ff3de6a82c4dc03adcef98919ff6bd6dc1603a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Jan 2012 00:12:17 +0100 Subject: fix typos in comments reported by the lintian in very-picky-modes --- apt-pkg/packagemanager.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index dd08a48ad..c32c73212 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -322,22 +322,22 @@ bool pkgPackageManager::ConfigureAll() only shown when debuging*/ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) { - // If this is true, only check and correct and dependancies without the Loop flag + // If this is true, only check and correct and dependencies without the Loop flag bool PkgLoop = List->IsFlag(Pkg,pkgOrderList::Loop); if (Debug) { VerIterator InstallVer = VerIterator(Cache,Cache[Pkg].InstallVer); clog << OutputInDepth(Depth) << "SmartConfigure " << Pkg.Name() << " (" << InstallVer.VerStr() << ")"; if (PkgLoop) - clog << " (Only Correct Dependancies)"; + clog << " (Only Correct Dependencies)"; clog << endl; } VerIterator const instVer = Cache[Pkg].InstVerIter(Cache); - /* Because of the ordered list, most dependancies should be unpacked, + /* Because of the ordered list, most dependencies should be unpacked, however if there is a loop (A depends on B, B depends on A) this will not - be the case, so check for dependancies before configuring. */ + be the case, so check for dependencies before configuring. */ bool Bad = false; for (DepIterator D = instVer.DependsList(); D.end() == false; ) @@ -424,7 +424,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) if (Start==End) { if (Bad && Debug && List->IsFlag(DepPkg,pkgOrderList::Loop) == false) - std::clog << OutputInDepth(Depth) << "Could not satisfy dependancies for " << Pkg.Name() << std::endl; + std::clog << OutputInDepth(Depth) << "Could not satisfy dependencies for " << Pkg.Name() << std::endl; break; } else { Start++; -- cgit v1.2.3 From aaab10075397cb4f2ec262c5d478f7ea8acd2d23 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Jan 2012 01:02:36 +0100 Subject: fix a few esoteric cppcheck errors/warnings/infos --- apt-pkg/packagemanager.cc | 1 - cmdline/apt-get.cc | 2 +- methods/gpgv.cc | 12 ++++++++++-- methods/rred.cc | 7 ++++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index c32c73212..a370f15a3 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -529,7 +529,6 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg) List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States); return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge); - return true; } /*}}}*/ // PM::SmartUnPack - Install helper /*{{{*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 85ae1cd7e..2d0554e21 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1730,7 +1730,7 @@ bool DoAutomaticRemove(CacheFile &Cache) Pkg != tooMuch.end() && Changed == false; ++Pkg) { APT::PackageSet too; - too.insert(Pkg); + too.insert(*Pkg); for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList(); Prv.end() == false; ++Prv) too.insert(Prv.ParentPkg()); diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 2b2aba017..25ba0d063 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -98,8 +98,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, // Read a line. Sigh. while ((c = getc(pipein)) != EOF && c != '\n') { - if (bufferoff == buffersize) - buffer = (char *) realloc(buffer, buffersize *= 2); + if (bufferoff == buffersize) + { + char* newBuffer = (char *) realloc(buffer, buffersize *= 2); + if (newBuffer == NULL) + { + free(buffer); + return "Couldn't allocate a buffer big enough for reading"; + } + buffer = newBuffer; + } *(buffer+bufferoff) = c; bufferoff++; } diff --git a/methods/rred.cc b/methods/rred.cc index e37a12ed9..1e352d0e7 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -333,7 +333,12 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ } if(command_count == command_alloc) { command_alloc = (command_alloc + 64) * 3 / 2; - commands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + EdCommand* newCommands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + if (newCommands == NULL) { + free(commands); + return MMAP_FAILED; + } + commands = newCommands; } commands[command_count++] = cmd; } -- cgit v1.2.3 From 18aea9e6c38ec0397e546563b8a54a99b431028b Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 20 Jan 2012 01:34:31 +0100 Subject: * test/libapt/globalerror_test.cc: - errno 0 has a different strerror on hurd, so generate the expected message dynamically instead of hardcoding 'Success' (Closes: #656530) --- debian/changelog | 7 ++++++- test/libapt/globalerror_test.cc | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 299afcf54..99c3a2032 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,7 +22,12 @@ apt (0.8.16~exp12) experimental; urgency=low which generates malformed requests, thanks Mel Collins for the hint! (Closes: #646381) - -- David Kalnischkies Thu, 19 Jan 2012 23:43:03 +0100 + [ Pino Toscano ] + * test/libapt/globalerror_test.cc: + - errno 0 has a different strerror on hurd, so generate the expected + message dynamically instead of hardcoding 'Success' (Closes: #656530) + + -- David Kalnischkies Fri, 20 Jan 2012 01:31:30 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc index 5d27414f9..72044d493 100644 --- a/test/libapt/globalerror_test.cc +++ b/test/libapt/globalerror_test.cc @@ -3,9 +3,12 @@ #include "assert.h" #include #include +#include int main(int argc,char *argv[]) { + std::string const textOfErrnoZero(strerror(0)); + equals(_error->empty(), true); equals(_error->PendingError(), false); equals(_error->Notice("%s Notice", "A"), false); @@ -80,7 +83,7 @@ int main(int argc,char *argv[]) equals(_error->PendingError(), true); equals(_error->PopMessage(text), true); equals(_error->PendingError(), false); - equals(text, "Something horrible happend 2 times - errno (0: Success)"); + equals(text, std::string("Something horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->empty(), true); std::string longText; @@ -92,7 +95,7 @@ int main(int argc,char *argv[]) equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happend", 2), false); equals(_error->PopMessage(text), true); - equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: Success)")); + equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->Warning("Репозиторий не обновлён и будут %d %s", 4, "test"), false); equals(_error->PopMessage(text), false); -- cgit v1.2.3 From 809cf6d22a9bb72061aedf2670c78b57d9da6999 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Jan 2012 02:00:48 +0100 Subject: * test/libapt/run-tests: - hurd doesn't have dmesg yet and we don't really need it either, so use with $0 a more stable data source for hashsumming --- debian/changelog | 5 ++++- test/libapt/run-tests | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 99c3a2032..9484063bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,13 +21,16 @@ apt (0.8.16~exp12) experimental; urgency=low - use curls list append instead of appending Range and If-Range by hand which generates malformed requests, thanks Mel Collins for the hint! (Closes: #646381) + * test/libapt/run-tests: + - hurd doesn't have dmesg yet and we don't really need it either, + so use with $0 a more stable data source for hashsumming [ Pino Toscano ] * test/libapt/globalerror_test.cc: - errno 0 has a different strerror on hurd, so generate the expected message dynamically instead of hardcoding 'Success' (Closes: #656530) - -- David Kalnischkies Fri, 20 Jan 2012 01:31:30 +0100 + -- David Kalnischkies Fri, 20 Jan 2012 01:43:07 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/test/libapt/run-tests b/test/libapt/run-tests index 5fff4ecca..d4341412d 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -67,11 +67,9 @@ do "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-st.bak" \ "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE" elif [ $name = "HashSums${EXT}" ]; then - TMP="$(mktemp)" - dmesg > $TMP + TMP="$(readlink -f "./${0}")" echo -n "Testing with \033[1;35m${name}\033[0m ... " LD_LIBRARY_PATH=${LDPATH} ${testapp} $TMP $(md5sum $TMP | cut -d' ' -f 1) $(sha1sum $TMP | cut -d' ' -f 1) $(sha256sum $TMP | cut -d' ' -f 1) $(sha512sum $TMP | cut -d' ' -f 1) && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m" - rm $TMP continue elif [ $name = "CompareVersion${EXT}" ]; then tmppath="${DIR}/versions.lst" -- cgit v1.2.3 From 3102af74e7ffaab3f47741c05451ce7f0e3b38fe Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 24 Jan 2012 14:02:04 +0100 Subject: releasing version 0.8.16~exp12 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9484063bb..0b49bf981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,7 +30,7 @@ apt (0.8.16~exp12) experimental; urgency=low - errno 0 has a different strerror on hurd, so generate the expected message dynamically instead of hardcoding 'Success' (Closes: #656530) - -- David Kalnischkies Fri, 20 Jan 2012 01:43:07 +0100 + -- Michael Vogt Tue, 24 Jan 2012 12:24:38 +0100 apt (0.8.16~exp11) experimental; urgency=low -- cgit v1.2.3