Explorar el Código

Arch() on a MultiArch:all version should return "all" to be compatible
with previous usecases. You now need to requested with Arch(true) the
return of the architecture this version (and pseudo package) was created for.

David Kalnischkies hace 16 años
padre
commit
c5dac10c3d
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      apt-pkg/cacheiterators.h

+ 10 - 1
apt-pkg/cacheiterators.h

@@ -178,7 +178,16 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
 	// Accessors
 	// Accessors
 	inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
 	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 *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 PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
 
 
 	inline DescIterator DescriptionList() const;
 	inline DescIterator DescriptionList() const;