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

do not show summary in "apt list"

Michael Vogt лет назад: 12
Родитель
Сommit
500347df3c
3 измененных файлов с 11 добавлено и 6 удалено
  1. 1 1
      apt-private/private-list.cc
  2. 8 4
      apt-private/private-output.cc
  3. 2 1
      apt-private/private-output.h

+ 1 - 1
apt-private/private-list.cc

@@ -149,7 +149,7 @@ bool List(CommandLine &Cmd)
          output_map.insert(std::make_pair<std::string, std::string>(
             V.ParentPkg().Name(), outs.str()));
       } else {
-         ListSingleVersion(CacheFile, records, V, outs);
+         ListSingleVersion(CacheFile, records, V, outs, false);
          output_map.insert(std::make_pair<std::string, std::string>(
                            V.ParentPkg().Name(), outs.str()));
       }

+ 8 - 4
apt-private/private-output.cc

@@ -158,7 +158,8 @@ std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pk
 }
 									/*}}}*/
 void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,	/*{{{*/
-                       pkgCache::VerIterator V, std::ostream &out)
+                       pkgCache::VerIterator V, std::ostream &out,
+                       bool include_summary)
 {
    pkgCache::PkgIterator P = V.ParentPkg();
 
@@ -224,9 +225,12 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,	/*{{{*/
             out << GetVersion(CacheFile, V);
       }
       out << " " << GetArchitecture(CacheFile, P) << " ";
-      out << std::endl 
-                << "    " << GetShortDescription(CacheFile, records, P)
-                << std::endl;
+      if (include_summary)
+      {
+         out << std::endl 
+             << "    " << GetShortDescription(CacheFile, records, P)
+             << std::endl;
+      }
    }
 }
 									/*}}}*/

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

@@ -24,7 +24,8 @@ extern unsigned int ScreenWidth;
 
 bool InitOutput();
 void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, 
-                       pkgCache::VerIterator V, std::ostream &out);
+                       pkgCache::VerIterator V, std::ostream &out,
+                       bool include_summary=true);