Просмотр исходного кода

include "Archive-Origin" in the apt show output

Michael Vogt лет назад: 12
Родитель
Сommit
0c8b600169
3 измененных файлов с 8 добавлено и 1 удалено
  1. 5 1
      apt-private/private-output.h
  2. 2 0
      apt-private/private-show.cc
  3. 1 0
      test/integration/test-apt-cli-show

+ 5 - 1
apt-private/private-output.h

@@ -28,7 +28,7 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,
                        bool include_summary=true);
 
 
-
+// helper to describe global state
 bool ShowList(std::ostream &out, std::string Title, std::string List,
               std::string VersionsList);
 void ShowBroken(std::ostream &out,CacheFile &Cache,bool Now);
@@ -43,6 +43,10 @@ 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);

+ 2 - 0
apt-private/private-show.cc

@@ -73,12 +73,14 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
    else
       package_size = _("unknown");
 
+   std::string suite = GetArchiveSuite(CacheFile, V);
    TFRewriteData RW[] = {
       {"Conffiles",0},
       {"Description",0},
       {"Description-md5",0},
       {"Installed-Size", installed_size.c_str(), 0},
       {"Size", package_size.c_str(), "Download-Size"},
+      {"Archive-Origin", suite.c_str(), 0},
       {}
    };
    if(TFRewrite(stdout, Tags, NULL, RW) == false)

+ 1 - 0
test/integration/test-apt-cli-show

@@ -25,6 +25,7 @@ Architecture: all
 Version: 1.0
 Filename: pool/main/foo/foo_1.0_all.deb
 Download-Size: unknown
+Archive-Origin: unstable
 Description: Some description 
  That has multiple lines
 " apt show foo