apt-key del: Ignore case when checking if a keyid exists in a keyring.
[ntk/apt.git] / apt-pkg / cachefilter.cc
index 64cde41..e388f24 100644 (file)
@@ -9,10 +9,12 @@
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/macros.h>
 
 #include <string>
-
+#include <string.h>
 #include <regex.h>
 #include <fnmatch.h>
 
@@ -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 <kernel>-<cpu> tuple                                        /*{{{*/
 //----------------------------------------------------------------------
 /* The complete architecture, consisting of <kernel>-<cpu>. */