summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-09-28 14:50:38 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-09-28 14:50:38 +0200
commit24fd9c0645b34ebb433588582d4e593cfcc5427a (patch)
treee91550ddf8b6791a8ea98fba57874f2e0d5a11b4
parent6fdb6892cbc333b6be5ff6a3cc55879a17f78430 (diff)
parent173c98da4cfa28ccde70c4d503fcdf6230b9085f (diff)
merged from lp:~donkult/apt/sid
-rw-r--r--apt-pkg/depcache.cc2
-rw-r--r--apt-pkg/pkgcache.cc25
-rw-r--r--apt-pkg/pkgcachegen.cc5
-rw-r--r--cmdline/apt-cache.cc10
-rw-r--r--debian/changelog18
-rwxr-xr-xtest/integration/test-bug-686346-package-missing-architecture22
-rwxr-xr-xtest/integration/test-conflicts-real-multiarch-same50
7 files changed, 125 insertions, 7 deletions
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/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 54b07c465..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<pkgCache::PkgIterator> 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<pkgCache::VerIterator> 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<pkgCache::VerIterator> DynV(Ver);
Ver->NextVer = Next;
Ver->ID = Cache.HeaderP->VersionCount++;
map_ptrloc const idxVerStr = WriteStringInMap(VerStr);
@@ -922,7 +925,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<pkgCache::PkgIterator> DynPkg(Pkg);
if (Pkg.end() == true) {
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index ce869581b..0a2c28d23 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -597,6 +597,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
bool const Installed = _config->FindB("APT::Cache::Installed", false);
bool const Important = _config->FindB("APT::Cache::Important", false);
bool const ShowDepType = _config->FindB("APT::Cache::ShowDependencyType", RevDepends == false);
+ bool const ShowVersion = _config->FindB("APT::Cache::ShowVersion", false);
bool const ShowPreDepends = _config->FindB("APT::Cache::ShowPre-Depends", true);
bool const ShowDepends = _config->FindB("APT::Cache::ShowDepends", true);
bool const ShowRecommends = _config->FindB("APT::Cache::ShowRecommends", Important == false);
@@ -646,10 +647,13 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
if (ShowDepType == true)
cout << D.DepType() << ": ";
if (Trg->VersionList == 0)
- cout << "<" << Trg.FullName(true) << ">" << endl;
+ cout << "<" << Trg.FullName(true) << ">";
else
- cout << Trg.FullName(true) << endl;
-
+ cout << Trg.FullName(true);
+ if (ShowVersion == true && D->Version != 0)
+ cout << " (" << pkgCache::CompTypeDeb(D->CompareOp) << ' ' << D.TargetVer() << ')';
+ cout << std::endl;
+
if (Recurse == true && Shown[Trg->ID] == false)
{
Shown[Trg->ID] = true;
diff --git a/debian/changelog b/debian/changelog
index 86f8579a7..607dddcfa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+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
+ * 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
+ * cmdline/apt-cache.cc:
+ - print versioned dependency relations in (r)depends if the option
+ 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!
+
+ -- David Kalnischkies <kalnischkies@gmail.com> 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
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