]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.cc
* apt-pkg/contrib/configuration.cc:
[apt.git] / apt-pkg / pkgcache.cc
index ae11057edadd76fece69a8bdc2403cd8731755e9..a66a5198d507f9bf35667660ae510a6bd0415839 100644 (file)
@@ -664,6 +664,30 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End)
    }
 }
                                                                        /*}}}*/
+// ostream operator to handle string representation of a dependecy     /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+std::ostream& operator<<(ostream& out, pkgCache::DepIterator D)
+{
+   if (D.end() == true)
+      return out << "invalid dependency";
+
+   pkgCache::PkgIterator P = D.ParentPkg();
+   pkgCache::PkgIterator T = D.TargetPkg();
+
+   out << (P.end() ? "invalid pkg" : P.FullName(false)) << " " << D.DepType()
+       << " on ";
+   if (T.end() == true)
+      out << "invalid pkg";
+   else
+      out << T;
+
+   if (D->Version != 0)
+      out << " (" << D.CompType() << " " << D.TargetVer() << ")";
+
+   return out;
+}
+                                                                       /*}}}*/
 // VerIterator::CompareVer - Fast version compare for same pkgs                /*{{{*/
 // ---------------------------------------------------------------------
 /* This just looks over the version list to see if B is listed before A. In
@@ -870,7 +894,8 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
       pkgCache::DescIterator Desc = DescDefault;
 
       for (; Desc.end() == false; Desc++)
-        if (*l == Desc.LanguageCode())
+        if (*l == Desc.LanguageCode() ||
+            (*l == "en" && strcmp(Desc.LanguageCode(),"") == 0))
            break;
       if (Desc.end() == true) 
         Desc = DescDefault;