#include <apti18n.h>
/*}}}*/
-struct PackageSortAlphabetic
+struct PackageSortAlphabetic /*{{{*/
{
bool operator () (const pkgCache::PkgIterator &p_lhs,
const pkgCache::PkgIterator &p_rhs)
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);
}
}
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)
{
Ver.end() == false; Ver++)
ListSingleVersion(CacheFile, records, Ver, outs);
}
-
+ /*}}}*/
// list - list package based on criteria /*{{{*/
// ---------------------------------------------------------------------
bool List(CommandLine &Cmd)