]> git.saurik.com Git - apt.git/commitdiff
search for pkg names in the cache case-sensitive
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 19 Jun 2014 09:59:41 +0000 (11:59 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 26 Sep 2014 22:09:15 +0000 (00:09 +0200)
Package names have to be lowercase (debian-policy ยง5.6.1) and in as
lowlevel as these method are it would be quiet strange to treat an
invalid package "suddently" as a valid one which other tools might or
might not accept. If case-insensitivity is really needed the frontend
should ensure this rather than these methods waste cpu cycles by
default.

Git-Dch: Ignore

apt-pkg/pkgcache.cc

index 7a913d2bb92310c35878ee5f047d6a01a706c98e..467d15eae63692c1b5a2dae5bd4a066b9a3ab97c 100644 (file)
@@ -215,7 +215,7 @@ pkgCache::PkgIterator pkgCache::SingleArchFindPkg(const string &Name)
    Package *Pkg = PkgP + HeaderP->PkgHashTable()[Hash(Name)];
    for (; Pkg != PkgP; Pkg = PkgP + Pkg->Next)
    {
    Package *Pkg = PkgP + HeaderP->PkgHashTable()[Hash(Name)];
    for (; Pkg != PkgP; Pkg = PkgP + Pkg->Next)
    {
-      int const cmp = strcasecmp(Name.c_str(), StrP + (GrpP + Pkg->Group)->Name);
+      int const cmp = strcmp(Name.c_str(), StrP + (GrpP + Pkg->Group)->Name);
       if (cmp == 0)
         return PkgIterator(*this, Pkg);
       else if (cmp < 0)
       if (cmp == 0)
         return PkgIterator(*this, Pkg);
       else if (cmp < 0)
@@ -279,7 +279,7 @@ pkgCache::GrpIterator pkgCache::FindGrp(const string &Name) {
                if (unlikely(Grp->Name == 0))
                   continue;
 
                if (unlikely(Grp->Name == 0))
                   continue;
 
-               int const cmp = strcasecmp(Name.c_str(), StrP + Grp->Name);
+               int const cmp = strcmp(Name.c_str(), StrP + Grp->Name);
                if (cmp == 0)
                        return GrpIterator(*this, Grp);
                else if (cmp < 0)
                if (cmp == 0)
                        return GrpIterator(*this, Grp);
                else if (cmp < 0)
@@ -356,7 +356,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
           last one we check, so we do it now. */
        if (Arch == "native" || Arch == myArch || Arch == "all") {
                pkgCache::Package *Pkg = Owner->PkgP + S->LastPackage;
           last one we check, so we do it now. */
        if (Arch == "native" || Arch == myArch || Arch == "all") {
                pkgCache::Package *Pkg = Owner->PkgP + S->LastPackage;
-               if (strcasecmp(myArch, Owner->StrP + Pkg->Arch) == 0)
+               if (strcmp(myArch, Owner->StrP + Pkg->Arch) == 0)
                        return PkgIterator(*Owner, Pkg);
                Arch = myArch;
        }
                        return PkgIterator(*Owner, Pkg);
                Arch = myArch;
        }
@@ -368,7 +368,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
        for (pkgCache::Package *Pkg = PackageList(); Pkg != Owner->PkgP;
             Pkg = Owner->PkgP + Pkg->Next) {
                if (S->Name == (Owner->GrpP + Pkg->Group)->Name &&
        for (pkgCache::Package *Pkg = PackageList(); Pkg != Owner->PkgP;
             Pkg = Owner->PkgP + Pkg->Next) {
                if (S->Name == (Owner->GrpP + Pkg->Group)->Name &&
-                   stringcasecmp(Arch, Owner->StrP + Pkg->Arch) == 0)
+                   stringcmp(Arch, Owner->StrP + Pkg->Arch) == 0)
                        return PkgIterator(*Owner, Pkg);
                if ((Owner->PkgP + S->LastPackage) == Pkg)
                        break;
                        return PkgIterator(*Owner, Pkg);
                if ((Owner->PkgP + S->LastPackage) == Pkg)
                        break;