]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cachefilter.cc
warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
[apt.git] / apt-pkg / cachefilter.cc
index 58cc812bfeec0b6741462a27c32aea266b215a59..57b9af15987e1a4bebe02a80dfc03ac57ef5f1b7 100644 (file)
@@ -55,6 +55,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 <kernel>-<cpu> tuple                                        /*{{{*/
 //----------------------------------------------------------------------
 /* The complete architecture, consisting of <kernel>-<cpu>. */
@@ -71,8 +82,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) {/*{{{*/