X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b917917067e757c4479a344a263ef7cf43c00866..e81ccffc7a9cc222570adfddf9d08df7cce82691:/apt-private/private-list.cc diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index ac72ce51a..8c61fcae8 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -42,7 +42,7 @@ #include /*}}}*/ -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 filters; std::vector::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)