]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-list.cc
update Uploaders to match recent uploaders better
[apt.git] / apt-private / private-list.cc
index ac72ce51a6c7013bdc9783ee3cee4ea471fdb3f1..8c61fcae8a93f63d35ad976d0858c43e75f12265 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,20 +52,28 @@ 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)
    {
       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::UseRegexp", false) == true)
             cachefilter = new APT::CacheFilter::PackageNameMatchesRegEx(pattern);
          else
             cachefilter = new APT::CacheFilter::PackageNameMatchesFnmatch(pattern);
+#endif
          filters.push_back(cachefilter);
       }
    }
@@ -88,10 +96,10 @@ class PackageNameMatcher : public Matcher
 private:
    std::vector<APT::CacheFilter::PackageMatcher*> filters;   
    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)
 {
@@ -99,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)