X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a9fe592842bfa17d91f4904d7fb0e3af3adebb17..9b78cda6873104b80ffdbc8b5d3965575ce0a31d:/apt-pkg/cacheiterators.h

diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index eb8dee5e3..26070636e 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -75,8 +75,8 @@ template<typename Str, typename Itr> class pkgCache::Iterator :
 	inline bool IsGood() const { return S && Owner && ! end();};
 	inline unsigned long Index() const {return S - OwnerPointer();};
 
-	void ReOwn(pkgCache &newOwner, void const * const oldMap, void const * const newMap) {
-		if (S == 0)
+	void ReMap(void const * const oldMap, void const * const newMap) {
+		if (Owner == 0 || S == 0)
 			return;
 		S += (Str*)(newMap) - (Str*)(oldMap);
 	}
@@ -115,8 +115,11 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
 	/** \brief find the package with the "best" architecture
 
 	    The best architecture is either the "native" or the first
-	    in the list of Architectures which is not an end-Pointer */
-	PkgIterator FindPreferredPkg() const;
+	    in the list of Architectures which is not an end-Pointer
+
+	    \param PreferNonVirtual tries to respond with a non-virtual package
+		   and only if this fails returns the best virtual package */
+	PkgIterator FindPreferredPkg(bool const &PreferNonVirtual = true) const;
 	PkgIterator NextPkg(PkgIterator const &Pkg) const;
 
 	// Constructors
@@ -290,6 +293,9 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
 	inline const char *CompType() const {return Owner->CompType(S->CompareOp);};
 	inline const char *DepType() const {return Owner->DepType(S->Type);};
 
+	//Nice printable representation
+	friend std::ostream& operator <<(std::ostream& out, DepIterator D);
+
 	inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) :
 		Iterator<Dependency, DepIterator>(Owner, Trg), Type(DepVer) {
 		if (S == 0)