]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-list.cc
* enable release based selection for deb-src (closes: 731102)
[apt.git] / apt-private / private-list.cc
index c3a21aafcdea22e41c3b5db47d558435155467b5..a02ebf02d091676e8d5c601a6b5cdc9133c9793c 100644 (file)
@@ -42,7 +42,7 @@
 #include <apti18n.h>
                                                                        /*}}}*/
 
-struct PackageSortAlphabetic
+struct PackageSortAlphabetic                                           /*{{{*/
 {
    bool operator () (const pkgCache::PkgIterator &p_lhs, 
                      const pkgCache::PkgIterator &p_rhs)
@@ -52,12 +52,12 @@ struct PackageSortAlphabetic
        return (l_name < r_name);
     }
 };
-
+                                                                       /*}}}*/
+class PackageNameMatcher : public Matcher                              /*{{{*/
+{
 #ifdef PACKAGE_MATCHER_ABI_COMPAT
 #define PackageMatcher PackageNameMatchesFnmatch
 #endif
-class PackageNameMatcher : public Matcher
-{
   public:
    PackageNameMatcher(const char **patterns)
    {
@@ -69,7 +69,7 @@ class PackageNameMatcher : public Matcher
             cachefilter = new APT::CacheFilter::PackageNameMatchesFnmatch(pattern);
 #else
          APT::CacheFilter::PackageMatcher *cachefilter = NULL;
-         if(_config->FindB("APT::Cmd::UseRegexp", false) == true)
+         if(_config->FindB("APT::Cmd::Use-Regexp", false) == true)
             cachefilter = new APT::CacheFilter::PackageNameMatchesRegEx(pattern);
          else
             cachefilter = new APT::CacheFilter::PackageNameMatchesFnmatch(pattern);
@@ -98,9 +98,8 @@ private:
    std::vector<APT::CacheFilter::PackageMatcher*>::const_iterator J;
    #undef PackageMatcher
 };
-
-
-void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, 
+                                                                       /*}}}*/
+void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,     /*{{{*/
                      pkgCache::PkgIterator P,    
                      std::ostream &outs)
 {
@@ -108,7 +107,7 @@ void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,
         Ver.end() == false; Ver++) 
       ListSingleVersion(CacheFile, records, Ver, outs);
 }
-
+                                                                       /*}}}*/
 // list - list package based on criteria                               /*{{{*/
 // ---------------------------------------------------------------------
 bool List(CommandLine &Cmd)
@@ -133,6 +132,8 @@ bool List(CommandLine &Cmd)
    std::map<std::string, std::string> output_map;
    std::map<std::string, std::string>::const_iterator K;
 
+   bool includeSummary = _config->FindB("APT::Cmd::List-Include-Summary");
+
    PackageNameMatcher matcher(patterns);
    LocalitySortedVersionSet bag;
    OpTextProgress progress;
@@ -144,13 +145,13 @@ bool List(CommandLine &Cmd)
    for (LocalitySortedVersionSet::iterator V = bag.begin(); V != bag.end(); V++)
    {
       std::stringstream outs;
-      if(_config->FindB("APT::Cmd::AllVersions", false) == true)
+      if(_config->FindB("APT::Cmd::All-Versions", false) == true)
       {
          ListAllVersions(CacheFile, records, V.ParentPkg(), outs);
          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, includeSummary);
          output_map.insert(std::make_pair<std::string, std::string>(
                            V.ParentPkg().Name(), outs.str()));
       }