]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-list.cc
edsp: support generic and solver-specific configs
[apt.git] / apt-private / private-list.cc
index d746acf3ffa488f58ae13db18a9285d290b08ab4..a948c7d9f2ae3fd723c8476e25788e54d5ded1d5 100644 (file)
@@ -37,28 +37,20 @@ struct PackageSortAlphabetic                                                /*{{{*/
        return (l_name < r_name);
     }
 };
-                                                                       /*}}}*/
-class PackageNameMatcher : public Matcher                              /*{{{*/
+
+class PackageNameMatcher : public Matcher
 {
-#ifdef PACKAGE_MATCHER_ABI_COMPAT
-#define PackageMatcher PackageNameMatchesFnmatch
-#endif
   public:
-   PackageNameMatcher(const char **patterns)
+   explicit PackageNameMatcher(const char **patterns)
    {
       for(int i=0; patterns[i] != NULL; ++i)
       {
          std::string pattern = patterns[i];
-#ifdef PACKAGE_MATCHER_ABI_COMPAT
-            APT::CacheFilter::PackageNameMatchesFnmatch *cachefilter = NULL;
-            cachefilter = new APT::CacheFilter::PackageNameMatchesFnmatch(pattern);
-#else
          APT::CacheFilter::PackageMatcher *cachefilter = NULL;
          if(_config->FindB("APT::Cmd::Use-Regexp", false) == true)
             cachefilter = new APT::CacheFilter::PackageNameMatchesRegEx(pattern);
          else
             cachefilter = new APT::CacheFilter::PackageNameMatchesFnmatch(pattern);
-#endif
          filters.push_back(cachefilter);
       }
    }
@@ -67,7 +59,7 @@ class PackageNameMatcher : public Matcher                             /*{{{*/
       for(J=filters.begin(); J != filters.end(); ++J)
          delete *J;
    }
-   virtual bool operator () (const pkgCache::PkgIterator &P) 
+   virtual bool operator () (const pkgCache::PkgIterator &P) APT_OVERRIDE
    {
       for(J=filters.begin(); J != filters.end(); ++J)
       {
@@ -127,7 +119,7 @@ bool DoList(CommandLine &Cmd)
                             Cache->Head().PackageCount, 
                             Cache->Head().PackageCount,
                             _("Listing"));
-   GetLocalitySortedVersionSet(CacheFile, bag, matcher, progress);
+   GetLocalitySortedVersionSet(CacheFile, &bag, matcher, &progress);
    bool const ShowAllVersions = _config->FindB("APT::Cmd::All-Versions", false);
    std::map<std::string, std::string> output_map;
    for (LocalitySortedVersionSet::iterator V = bag.begin(); V != bag.end(); ++V)