X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/f5294bcd79eb970a58a26f9abf7956c55ca71cf3..1262d35895c930f3fa49d7b4182cdd7a4a841f74:/apt-pkg/cachefilter.cc diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc index 58cc812bf..e388f2450 100644 --- a/apt-pkg/cachefilter.cc +++ b/apt-pkg/cachefilter.cc @@ -9,10 +9,12 @@ #include #include #include +#include #include +#include #include - +#include #include #include @@ -55,6 +57,17 @@ PackageNameMatchesRegEx::~PackageNameMatchesRegEx() { /*{{{*/ } /*}}}*/ +// Fnmatch support /*{{{*/ +//---------------------------------------------------------------------- +bool PackageNameMatchesFnmatch::operator() (pkgCache::PkgIterator const &Pkg) {/*{{{*/ + return fnmatch(Pattern.c_str(), Pkg.Name(), FNM_CASEFOLD) == 0; +} + /*}}}*/ +bool PackageNameMatchesFnmatch::operator() (pkgCache::GrpIterator const &Grp) {/*{{{*/ + return fnmatch(Pattern.c_str(), Grp.Name(), FNM_CASEFOLD) == 0; +} + /*}}}*/ + // CompleteArch to - tuple /*{{{*/ //---------------------------------------------------------------------- /* The complete architecture, consisting of -. */ @@ -71,8 +84,7 @@ static std::string CompleteArch(std::string const &arch) { } /*}}}*/ PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern) :/*{{{*/ - literal(pattern), isPattern(isPattern), d(NULL) { - complete = CompleteArch(pattern); + literal(pattern), complete(CompleteArch(pattern)), isPattern(isPattern), d(NULL) { } /*}}}*/ bool PackageArchitectureMatchesSpecification::operator() (char const * const &arch) {/*{{{*/