]> git.saurik.com Git - apt.git/commitdiff
Arch() on a MultiArch:all version should return "all" to be compatible
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 11 Feb 2010 17:20:02 +0000 (18:20 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 11 Feb 2010 17:20:02 +0000 (18:20 +0100)
with previous usecases. You now need to requested with Arch(true) the
return of the architecture this version (and pseudo package) was created for.

apt-pkg/cacheiterators.h

index d8e044f88f8938a9192dfcc1628c763f76af9748..e8cf28496f9a551b8e6c121db1262ec7443c885f 100644 (file)
@@ -178,7 +178,16 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
        // Accessors
        inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
        inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
        // Accessors
        inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
        inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
-       inline const char *Arch() const {return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;};
+       inline const char *Arch() const {
+               if(S->MultiArch == pkgCache::Version::All)
+                       return "all";
+               return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
+       };
+       inline const char *Arch(bool const pseudo) const {
+               if(pseudo == false)
+                       return Arch();
+               return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
+       };
        inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
 
        inline DescIterator DescriptionList() const;
        inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
 
        inline DescIterator DescriptionList() const;