diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-24 21:17:07 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-24 21:17:07 +0100 |
commit | 1179953a0bbf82ba22a2692586ce4f1936b2bdc9 (patch) | |
tree | 92073340dd9e5684bbe8399794709aab3e4a3bc5 /apt-private | |
parent | 85d7c0eb60efd0de13ad331676b6227f52bed6c6 (diff) |
show APT-Sources in apt show
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-output.h | 4 | ||||
-rw-r--r-- | apt-private/private-show.cc | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/apt-private/private-output.h b/apt-private/private-output.h index ba04ee221..2a2a69458 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -43,10 +43,6 @@ bool ShowEssential(std::ostream &out,CacheFile &Cache); void Stats(std::ostream &out, pkgDepCache &Dep); -// helpers to display single package data -std::string -GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver); - // prompting bool YnPrompt(bool Default=true); bool AnalPrompt(const char *Text); diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index cee132843..ba8b266ee 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -54,6 +54,15 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V, if (I.IsOk() == false) return _error->Error(_("Package file %s is out of sync."),I.FileName()); + // find matching sources.list metaindex + pkgSourceList *SrcList = CacheFile.GetSourceList(); + pkgIndexFile *Index; + if (SrcList->FindIndex(I, Index) == false && + _system->FindIndex(I, Index) == false) + return _error->Error("Can not find indexfile for Package %s (%s)", + V.ParentPkg().Name(), V.VerStr()); + std::string source_index_file = Index->Describe(true); + // Read the record FileFd PkgF; if (PkgF.Open(I.FileName(), FileFd::ReadOnly, FileFd::Extension) == false) @@ -83,15 +92,17 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V, manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no"; else manual_installed = 0; - std::string suite = GetArchiveSuite(CacheFile, V); TFRewriteData RW[] = { + // delete {"Conffiles",0}, {"Description",0}, {"Description-md5",0}, + // improve {"Installed-Size", installed_size.c_str(), 0}, {"Size", package_size.c_str(), "Download-Size"}, - {"Archive-Origin", suite.c_str(), 0}, - {"Manual-Installed", manual_installed, 0}, + // add + {"APT-Manual-Installed", manual_installed, 0}, + {"APT-Sources", source_index_file.c_str(), 0}, {} }; |