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 +- 1 file changed, 1 insertion(+), 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) { -- cgit v1.2.3 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 +++ 1 file changed, 3 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); -- cgit v1.2.3 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 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) (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; } -- cgit v1.2.3