Browse Source

drop obsolete explicit :none handling in pkgCacheGen

We archieve the same without the special handling now, so drop this code.
Makes supporting this abdomination a little longer bearable as well.

Git-Dch: Ignore
David Kalnischkies 7 years ago
  1. 3
  2. 50


@ -69,7 +69,8 @@ string debListParser::Package() {
// ---------------------------------------------------------------------
/* This will return the Architecture of the package this section describes */
string debListParser::Architecture() {
return Section.FindS("Architecture");
std::string const Arch = Section.FindS("Architecture");
return Arch.empty() ? "none" : Arch;
// ListParser::ArchitectureAll /*{{{*/


@ -229,22 +229,6 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
if (Arch.empty() == true)
// 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;
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
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;
Dynamic<pkgCache::PkgIterator> DynPkg(Pkg);
@ -440,40 +424,6 @@ 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<pkgCache::DepIterator> 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)
map_pointer_t *OldDepLast = NULL;
pkgCache::VerIterator ConVersion = D.ParentVer();
Dynamic<pkgCache::VerIterator> DynV(ConVersion);
// duplicate the Conflicts/Breaks/Replaces for :none arch
NewDepends(Pkg, ConVersion, D->Version,
D->CompareOp, D->Type, OldDepLast);
if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false))
return _error->Error(_("Error occurred while processing %s (%s%d)"),