diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-13 19:36:13 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-13 19:36:13 +0200 |
commit | 83852d882b05bdc21f95d7fbf76feea644499ca3 (patch) | |
tree | d63a1f58e181c23d4931c4db9133ca4662768ffc /apt-pkg/pkgcache.cc | |
parent | df164436e99095aee5e7df5dc8de7ef5dd1f20e9 (diff) | |
parent | 9349f80796a4b0be3ce2e732029ddd4a6558f80a (diff) |
merged from debian
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index ae11057ed..a66a5198d 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -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; |