pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 * Make the mangle and depot commands a b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3bef539e832b
branches:  trunk
changeset: 466483:3bef539e832b
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jan 19 10:09:36 2004 +0000

description:
* Make the mangle and depot commands a bit more conservative in finding
  instances of directory paths to mangle.  We now check that the path
  is either a word by itself, or else part of likely compiler/linker
  options (-[ILR]).

* Add a new "submangle" command that does the same thing as mangle but
  restricts itself to only the directory tree below the named src
  directory.

diffstat:

 mk/buildlink3/gen-transform.sh |  44 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 5 deletions(-)

diffs (75 lines):

diff -r 5cedc040128f -r 3bef539e832b mk/buildlink3/gen-transform.sh
--- a/mk/buildlink3/gen-transform.sh    Mon Jan 19 10:01:33 2004 +0000
+++ b/mk/buildlink3/gen-transform.sh    Mon Jan 19 10:09:36 2004 +0000
@@ -1,6 +1,6 @@
 #!@BUILDLINK_SHELL@
 #
-# $NetBSD: gen-transform.sh,v 1.14 2004/01/19 05:11:44 jlam Exp $
+# $NetBSD: gen-transform.sh,v 1.15 2004/01/19 10:09:36 jlam Exp $
 
 transform="@_BLNK_TRANSFORM_SEDFILE@"
 untransform="@_BLNK_UNTRANSFORM_SEDFILE@"
@@ -9,6 +9,7 @@
 # equivalents:
 #
 #      mangle:src:dst          mangles the directory "src" into "dst"
+#      submangle:src:dst       mangles "src/*" into "dst/*"
 #      rpath:src:dst           translates the directory "src" into "dst"
 #                                      in rpath options
 #      abs-rpath               removes all rpath options that try to add
@@ -46,9 +47,38 @@
                case "$action" in
                transform|untransform)
                        @CAT@ >> $sedfile << EOF
-s|$2\([/$_sep]\)|$3\1|g
-s|$2$|$3|g
+s|^$2\([/$_sep]\)|$3\1|g
+s|^$2$|$3|g
+s|\([$_sep]\)$2\([/$_sep]\)|\1$3\2|g
+s|\([$_sep]\)$2$|\1$3|g
+EOF
+                       case "$2" in
+                       -*)     ;;
+                       *)
+                               @CAT@ >> $sedfile << EOF
+s|\(-[ILR]\)$2\([/$_sep]\)|\1$3\2|g
+s|\(-[ILR]\)$2$|\1$3|g
 EOF
+                               ;;
+                       esac
+                       ;;
+               esac
+               ;;
+       submangle)
+               case "$action" in
+               transform|untransform)
+                       @CAT@ >> $sedfile << EOF
+s|^$2\(/[^/$_sep]\)|$3\1|g
+s|\([$_sep]\)$2\(/[^/$_sep]\)|\1$3\2|g
+EOF
+                       case "$2" in
+                       -*)     ;;
+                       *)
+                               @CAT@ >> $sedfile << EOF
+s|\(-[ILR]\)$2\(/[^/$_sep]\)|\1$3\2|g
+EOF
+                               ;;
+                       esac
                        ;;
                esac
                ;;
@@ -80,8 +110,12 @@
                case "$action" in
                transform|untransform)
                        @CAT@ >> $sedfile << EOF
-s|$2/[^/$_sep]*\(/[^$_sep]\)|$3\1|g
-s|$2/[^/$_sep]*$|$3|g
+s|^$2/[^/$_sep]*\(/[^$_sep]\)|$3\1|g
+s|^$2/[^/$_sep]*$|$3|g
+s|\([$_sep]\)$2/[^/$_sep]*\(/[^$_sep]\)|\1$3\2|g
+s|\([$_sep]\)$2/[^/$_sep]*$|\1$3|g
+s|\(-[ILR]\)$2/[^/$_sep]*\(/[^$_sep]\)|\1$3\2|g
+s|\(-[ILR]\)$2/[^/$_sep]*$|\1$3|g
 EOF
                        ;;
                esac



Home | Main Index | Thread Index | Old Index