Browse Source

use consistently the last : as name:arch separator

Proper debian packages do not contain ':' in the package name, so for
real packages this is a non-issue, but apt itself frequently makes use
of packages with such an illegal name for internal proposes.

Git-Dch: Ignore
debian/1.8.y
David Kalnischkies 6 years ago
parent
commit
074564d40c
  1. 2
      apt-pkg/pkgcache.cc
  2. 2
      apt-pkg/pkgcachegen.cc

2
apt-pkg/pkgcache.cc

@ -263,7 +263,7 @@ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) {
}
pkgCache::PkgIterator pkgCache::FindPkg(StringView Name) {
auto const found = Name.find(':');
auto const found = Name.rfind(':');
if (found == string::npos)
return FindPkg(Name, "native");
auto const Arch = Name.substr(found+1);

2
apt-pkg/pkgcachegen.cc

@ -659,7 +659,7 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
// lazy-create foo (of amd64) provides foo:amd64 at the time we first need it
if (Arch == "any")
{
size_t const found = Name.find(':');
size_t const found = Name.rfind(':');
StringView ArchA = Name.substr(found + 1);
if (ArchA != "any")
{

Loading…
Cancel
Save