diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-25 20:14:42 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-25 20:14:42 +0200 |
commit | 3dd823bb56cc972b634cc7525581d0c38b1cd026 (patch) | |
tree | 5bf3ed32c291f521ff19a3f4c815eadca532835d /cmdline/apt-cache.cc | |
parent | 131a3ca3e4e4eec9ae5307ce10a7b6c47aa14a54 (diff) | |
parent | dc67d95fa4cb0141235bf5b4195ffd39e4c96bf4 (diff) |
show in madison command again also source packages (LP: #614589)
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r-- | cmdline/apt-cache.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 6813d2978..74a4f69c2 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1664,10 +1664,11 @@ bool Madison(CommandLine &CmdL) _error->Discard(); APT::CacheSetHelper helper(true, GlobalError::NOTICE); - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (const char **I = CmdL.FileList + 1; *I != 0; I++) { - if (Pkg.end() == false) + _error->PushToStack(); + APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper); + for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; V++) { @@ -1698,16 +1699,21 @@ bool Madison(CommandLine &CmdL) } } - SrcRecs.Restart(); pkgSrcRecords::Parser *SrcParser; - while ((SrcParser = SrcRecs.Find(Pkg.Name(),false)) != 0) + bool foundSomething = false; + while ((SrcParser = SrcRecs.Find(*I, false)) != 0) { + foundSomething = true; // Maybe support Release info here too eventually cout << setw(10) << SrcParser->Package() << " | " << setw(10) << SrcParser->Version() << " | " << SrcParser->Index().Describe(true) << endl; } + if (foundSomething == true) + _error->RevertToStack(); + else + _error->MergeWithStack(); } return true; |