]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.cc
fix arguments for MarkInstall so packages are really marked as automatic
[apt.git] / apt-pkg / pkgcache.cc
index 616d400a256d9681b27b260ec77cc635a67d2a46..93d09a18ead569cd1ed271097bbb2fff76fa4a70 100644 (file)
@@ -211,11 +211,14 @@ pkgCache::PkgIterator pkgCache::SingleArchFindPkg(const string &Name)
 // ---------------------------------------------------------------------
 /* Returns 0 on error, pointer to the package otherwise */
 pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) {
-       if (MultiArchCache() == false)
-               return SingleArchFindPkg(Name);
        size_t const found = Name.find(':');
        if (found == string::npos)
-               return FindPkg(Name, "native");
+       {
+               if (MultiArchCache() == false)
+                       return SingleArchFindPkg(Name);
+               else
+                       return FindPkg(Name, "native");
+       }
        string const Arch = Name.substr(found+1);
        if (Arch == "any")
                return FindPkg(Name, "any");
@@ -317,22 +320,22 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
        if (unlikely(IsGood() == false || S->FirstPackage == 0))
                return PkgIterator(*Owner, 0);
 
+       /* If we accept any package we simply return the "first"
+          package in this group (the last one added). */
+       if (Arch == "any")
+               return PkgIterator(*Owner, Owner->PkgP + S->FirstPackage);
+
        static string const myArch = _config->Find("APT::Architecture");
        /* Most of the time the package for our native architecture is
           the one we add at first to the cache, but this would be the
           last one we check, so we do it now. */
-       if (Arch == "native" || Arch == myArch) {
+       if (Arch == "native" || Arch == myArch || Arch == "all") {
                Arch = myArch;
                pkgCache::Package *Pkg = Owner->PkgP + S->LastPackage;
                if (stringcasecmp(Arch, Owner->StrP + Pkg->Arch) == 0)
                        return PkgIterator(*Owner, Pkg);
        }
 
-       /* If we accept any package we simply return the "first"
-          package in this group (the last one added). */
-       if (Arch == "any")
-               return PkgIterator(*Owner, Owner->PkgP + S->FirstPackage);
-
        /* Iterate over the list to find the matching arch
           unfortunately this list includes "package noise"
           (= different packages with same calculated hash),
@@ -737,22 +740,8 @@ bool pkgCache::VerIterator::Automatic() const
    return false;
 }
                                                                        /*}}}*/
-// VerIterator::Pseudo - Check if this version is a pseudo one         /*{{{*/
-// ---------------------------------------------------------------------
-/* Sometimes you have the need to express dependencies with versions
-   which doesn't really exist or exist multiply times for "different"
-   packages. We need these versions for dependency resolution but they
-   are a problem everytime we need to download/install something. */
-bool pkgCache::VerIterator::Pseudo() const
-{
-   if (S->MultiArch == pkgCache::Version::All &&
-          strcmp(Arch(true),"all") != 0)
-   {
-          GrpIterator const Grp = ParentPkg().Group();
-          return (Grp->LastPackage != Grp->FirstPackage);
-   }
-   return false;
-}
+// VerIterator::Pseudo - deprecated no-op method                       /*{{{*/
+bool pkgCache::VerIterator::Pseudo() const { return false; }
                                                                        /*}}}*/
 // VerIterator::NewestFile - Return the newest file version relation   /*{{{*/
 // ---------------------------------------------------------------------