Rename pattern -> path for, duh, path patterns
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 10 Dec 2010 10:33:46 +0000 (12:33 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 10 Dec 2010 15:05:22 +0000 (17:05 +0200)
- 4.9 alpha used "pattern" but better fix the stupid name now than
  have to live with the non-obvious name forever
(cherry picked from commit a9bc1f51ae6bb6e1df0a5de71ac2a27b0932f144)

build/rpmfc.c
fileattrs/desktop.attr
fileattrs/libtool.attr
fileattrs/pkgconfig.attr
fileattrs/python.attr
macros.in

index 455a373..955529d 100644 (file)
@@ -21,9 +21,9 @@
 
 typedef struct rpmfcAttr_s {
     char *name;
-    regex_t *pattern;
+    regex_t *path;
     regex_t *magic;
-    regex_t *pattern_excl;
+    regex_t *path_excl;
     regex_t *magic_excl;
     ARGV_t flags;
 } * rpmfcAttr;
@@ -91,9 +91,9 @@ static rpmfcAttr rpmfcAttrNew(const char *name)
     free(flags);
 
     attr->name = xstrdup(name);
-    attr->pattern = rpmfcAttrReg(name, "pattern");
+    attr->path = rpmfcAttrReg(name, "path");
     attr->magic = rpmfcAttrReg(name, "magic");
-    attr->pattern_excl = rpmfcAttrReg(name, "exclude_pattern");
+    attr->path_excl = rpmfcAttrReg(name, "exclude_path");
     attr->magic_excl = rpmfcAttrReg(name, "exclude_magic");
     
     return attr;
@@ -102,17 +102,17 @@ static rpmfcAttr rpmfcAttrNew(const char *name)
 static rpmfcAttr rpmfcAttrFree(rpmfcAttr attr)
 {
     if (attr) {
-       if (attr->pattern) {
-           regfree(attr->pattern);
-           rfree(attr->pattern);
+       if (attr->path) {
+           regfree(attr->path);
+           rfree(attr->path);
        }
        if (attr->magic) {
            regfree(attr->magic);
            rfree(attr->magic);
        }
-       if (attr->pattern_excl) {
-           regfree(attr->pattern_excl);
-           rfree(attr->pattern_excl);
+       if (attr->path_excl) {
+           regfree(attr->path_excl);
+           rfree(attr->path_excl);
        }
        if (attr->magic_excl) {
            regfree(attr->magic_excl);
@@ -597,13 +597,13 @@ static void rpmfcAttributes(rpmfc fc, const char *ftype, const char *fullpath)
        /* Filter out path and magic exclude-matches */
        if (regMatch((*attr)->magic_excl, ftype))
            continue;
-       if (regMatch((*attr)->pattern_excl, path))
+       if (regMatch((*attr)->path_excl, path))
            continue;
 
        /* Add attributes on libmagic type & path pattern matches */
        if (regMatch((*attr)->magic, ftype))
            argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
-       if (regMatch((*attr)->pattern, path))
+       if (regMatch((*attr)->path, path))
            argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
     }
 }
index ff74864..f6882be 100644 (file)
@@ -1,2 +1,2 @@
 %__desktop_provides    %{_rpmconfigdir}/desktop-file.prov
-%__desktop_pattern     ^%{_datadir}/applications/.*\\.desktop$
+%__desktop_path        ^%{_datadir}/applications/.*\\.desktop$
index f2ab5e2..ed5cb8c 100644 (file)
@@ -1,3 +1,3 @@
 %__libtool_provides    %{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
 %__libtool_requires    %{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
-%__libtool_pattern     ^%{_libdir}/.*\.la$
+%__libtool_path        ^%{_libdir}/.*\.la$
index f3e00c6..1b4240d 100644 (file)
@@ -1,3 +1,3 @@
 %__pkgconfig_provides  %{_rpmconfigdir}/pkgconfigdeps.sh --provides
 %__pkgconfig_requires  %{_rpmconfigdir}/pkgconfigdeps.sh --requires
-%__pkgconfig_pattern   ^((%{_libdir}|%{_datadir})/pkgconfig/.*\.pc|%{_bindir}/pkg-config)$
+%__pkgconfig_path      ^((%{_libdir}|%{_datadir})/pkgconfig/.*\.pc|%{_bindir}/pkg-config)$
index aab7641..5b48f75 100644 (file)
@@ -1,4 +1,4 @@
 %__python_provides     %{_rpmconfigdir}/pythondeps.sh --provides
 %__python_requires     %{_rpmconfigdir}/pythondeps.sh --requires
-%__python_pattern      ^((/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]\\.[[:digit:]]))$
+%__python_path ^((/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]\\.[[:digit:]]))$
 %__python_magic                ^python.*(executable|byte-compiled)$
index aba3647..8894efd 100644 (file)
--- a/macros.in
+++ b/macros.in
@@ -488,10 +488,10 @@ print (t)\
 # %__myattr_requires   path + args to requires finder script for <myattr>
 # %__myattr_provides   path + args to provides finder script for <myattr>
 # %__myattr_magic      libmagic classification match regex
-# %__myattr_pattern    path based classification match regex
+# %__myattr_path       path based classification match regex
 # %__myattr_flags      flags to control behavior (just "exeonly" for now)
 # %__myattr_exclude_magic      exclude by magic regex
-# %__myattr_exclude_pattern    exclude by path regex
+# %__myattr_exclude_path       exclude by path regex
 #
 %_fileattrsdir         %{_rpmconfigdir}/fileattrs