pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Properly fix meta-characters quoting in awk regexp ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/af3f9591fe78
branches:  trunk
changeset: 464575:af3f9591fe78
user:      seb <seb%pkgsrc.org@localhost>
date:      Sat Dec 13 00:34:39 2003 +0000

description:
Properly fix meta-characters quoting in awk regexp specified as strings:
`\' needs to be quoted in a string.
Also remove some unnecessary `\' in awk strings.

diffstat:

 mk/bsd.pkg.mk |  64 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diffs (188 lines):

diff -r c15e3a600552 -r af3f9591fe78 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Fri Dec 12 23:18:40 2003 +0000
+++ b/mk/bsd.pkg.mk     Sat Dec 13 00:34:39 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1318 2003/12/11 22:27:40 grant Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1319 2003/12/13 00:34:39 seb Exp $
 #
 # This file is in the public domain.
 #
@@ -2685,7 +2685,7 @@
        BEGIN { linkc = 1 }                     \
        /^@/ { lines[NR] = $$0; next }          \
        function libtool_release(lib) {         \
-               if (gsub("-[^-]+\.so\.", "\.so\.", lib)) { \
+               if (gsub("-[^-]+\\.so\\.", ".so.", lib)) { \
                        if (system("${TEST} -h ${PREFIX}/" lib) == 0) { \
                                rels[NR] = lib; \
                        }                       \
@@ -2694,13 +2694,13 @@
        /.*\/lib[^\/]+\.so\.[0-9]+\.[0-9]+\.[0-9]+$$/ { \
                libtool_release($$0);           \
                lines[NR] = $$0;                \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2708,11 +2708,11 @@
        /.*\/lib[^\/]+\.so\.[0-9]+\.[0-9]+$$/ { \
                libtool_release($$0);           \
                lines[NR] = $$0;                \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2734,7 +2734,7 @@
 _DYLIB_AWK= \
        /^@/ { lines[NR] = $$0; next }          \
                function libtool_release(lib) {         \
-               if (gsub("\.so\.", "\.", lib) || gsub("\.so$$", "", lib)) { \
+               if (gsub("\\.so\\.", ".", lib) || gsub("\\.so$$", "", lib)) { \
                        lib = lib ".dylib"; \
                        if (system("${TEST} -h ${PREFIX}/" lib) == 0) { \
                                rels[NR] = lib; \
@@ -2745,13 +2745,13 @@
                libtool_release($$0);           \
                lines[NR] = $$0;                \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2760,11 +2760,11 @@
                libtool_release($$0);           \
                lines[NR] = $$0;                \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2773,9 +2773,9 @@
                libtool_release($$0);           \
                lines[NR] = $$0;                \
                links[linkc++] = $$0;           \
-               sub("\.[0-9]+$$", "");          \
+               sub("\\.[0-9]+$$", "");         \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2787,7 +2787,7 @@
                }                               \
                libtool_release($$0);           \
                links[linkc++] = $$0;           \
-               if (sub("-[^-]+\.so$$", "\.so")) { \
+               if (sub("-[^-]+\\.so$$", ".so")) { \
                        links[linkc++] = $$0;   \
                }                               \
                next                            \
@@ -2824,8 +2824,8 @@
 _AIXLIB_AWK= \
        /^@/ { lines[NR] = $$0; next }          \
        /.*\/lib[^\/]+\.so(\.[0-9]+)*$$/ {      \
-               sub("(\.[0-9]+)*$$", "");       \
-               sub("\.so$$", "\.a");           \
+               sub("(\\.[0-9]+)*$$", "");      \
+               sub("\\.so$$", ".a");           \
                lines[NR] = $$0;                \
                next                            \
        }                                       \
@@ -2839,7 +2839,7 @@
                        }                       \
                        if (j >= nlibs)         \
                                print lines[i]; \
-                       if (match(lines[i], ".*\/lib[^\/]+\.a$$")) { \
+                       if (match(lines[i], ".*/lib[^/]+\\.a$$")) { \
                                libs[nlibs] = lines[i]; \
                                nlibs++;        \
                        }                       \
@@ -4126,7 +4126,7 @@
                                        release = $$1;                  \
                                        arch = $$2;                     \
                                        pkg = $$3;                      \
-                                       gsub("\.tgz","", pkg);          \
+                                       gsub("\\.tgz","", pkg);         \
                                        if (arch != "m68k" && arch != "mipsel") { \
                                                if (arch in urls)       \
                                                        urls[arch "/" pkg "/" release] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a>, " 
urls[arch]; \
@@ -4489,19 +4489,19 @@
                /^@/ { print $$0; next }                                \
                /.*\/lib[^\/]+\.so\.[0-9]+\.[0-9]+\.[0-9]+$$/ {         \
                        print $$0;                                      \
-                       sub("\.[0-9]+$$", "");                          \
+                       sub("\\.[0-9]+$$", "");                         \
                        if ('$$genlinks') print $$0;                    \
-                       sub("\.[0-9]+$$", "");                          \
+                       sub("\\.[0-9]+$$", "");                         \
                        if ('$$genlinks') print $$0;                    \
-                       sub("\.[0-9]+$$", "");                          \
+                       sub("\\.[0-9]+$$", "");                         \
                        if ('$$genlinks') print $$0;                    \
                        next;                                           \
                }                                                       \
                /.*\/lib[^\/]+\.so\.[0-9]+\.[0-9]+$$/ {                 \
                        print $$0;                                      \
-                       sub("\.[0-9]+$$", "");                          \
+                       sub("\\.[0-9]+$$", "");                         \
                        if ('$$genlinks') print $$0;                    \
-                       sub("\.[0-9]+$$", "");                          \
+                       sub("\\.[0-9]+$$", "");                         \
                        if ('$$genlinks') print $$0;                    \
                        next;                                           \
                }                                                       \
@@ -4858,7 +4858,7 @@
 .endif
 
 _MANINSTALL_CMD= ${AWK} 'BEGIN{                                                \
-               start="^([^\/]*\/)*man\/([^\/]*\/)?";                   \
+               start="^([^/]*/)*man/([^/]*/)?";                        \
                end="[1-9ln]"; }                                        \
                { if (!"${MANINSTALL:Mmaninstall}" &&                   \
                                match($$0, start "man" end)) {next;}    \
@@ -4870,8 +4870,8 @@
 _IMAKE_MAN_CMD=        ${AWK} '/^([^\/]*\/)*man\/([^\/]*\/)?cat[1-9ln]\/.*0(\.gz)?$$/ { \
        sect = $$0; n = match(sect, "/cat[1-9ln]");                     \
        sect = sprintf(".%s", substr(sect, n + 4, 1));                  \
-       s = $$0; sub("/cat", "/man", s); sub("\.0(\.gz)?$$", sect, s);  \
-       if (match($$0, "\.gz$$") > 0) { ext = ".gz";} else { ext = "";} \
+       s = $$0; sub("/cat", "/man", s); sub("\\.0(\\.gz)?$$", sect, s);\
+       if (match($$0, "\\.gz$$") > 0) { ext = ".gz";} else { ext = "";} \
        $$0 = sprintf("%s%s", s, ext);                                  \
        } { print $$0; }' |
 .  else



Home | Main Index | Thread Index | Old Index