X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/eff0c22e59e65b6b63e854ff41eb091278e05714..070ed1c9147c092c1f944afd1c17c51f651a5c39:/apt-pkg/pkgcache.cc diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index f4fb073f5..c9c338e1e 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -59,7 +59,7 @@ pkgCache::Header::Header() /* Whenever the structures change the major version should be bumped, whenever the generator changes the minor version should be bumped. */ APT_HEADER_SET(MajorVersion, 10); - APT_HEADER_SET(MinorVersion, 3); + APT_HEADER_SET(MinorVersion, 5); APT_HEADER_SET(Dirty, false); APT_HEADER_SET(HeaderSz, sizeof(pkgCache::Header)); @@ -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); @@ -307,7 +307,7 @@ pkgCache::GrpIterator pkgCache::FindGrp(StringView Name) { // Look at the hash bucket for the group Group *Grp = GrpP + HeaderP->GrpHashTableP()[sHash(Name)]; for (; Grp != GrpP; Grp = GrpP + Grp->Next) { - int const cmp = Name.compare(StrP + Grp->Name); + int const cmp = Name.compare(ViewString(Grp->Name)); if (cmp == 0) return GrpIterator(*this, Grp); else if (cmp < 0) @@ -389,7 +389,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(StringView Arch) const { // Iterate over the list to find the matching arch for (pkgCache::Package *Pkg = PackageList(); Pkg != Owner->PkgP; Pkg = Owner->PkgP + Pkg->NextPackage) { - if (Arch.compare(Owner->StrP + Pkg->Arch) == 0) + if (Arch == Owner->ViewString(Pkg->Arch)) return PkgIterator(*Owner, Pkg); if ((Owner->PkgP + S->LastPackage) == Pkg) break;