pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/wrapper The "transform" file is used to transform a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/db07540c0333
branches:  trunk
changeset: 483243:db07540c0333
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Nov 09 17:16:16 2004 +0000

description:
The "transform" file is used to transform arguments on the command line.
The "untransform" file is used to unwrap *-config files and *.lai files.

The transform file can be much stricter about what command line arguments
should look like, so take advantage of that to fix the "libpath" and
"libpath-in-define" regression tests.

diffstat:

 mk/wrapper/gen-transform.sh |  53 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 46 insertions(+), 7 deletions(-)

diffs (104 lines):

diff -r 80a0cf168055 -r db07540c0333 mk/wrapper/gen-transform.sh
--- a/mk/wrapper/gen-transform.sh       Tue Nov 09 17:14:43 2004 +0000
+++ b/mk/wrapper/gen-transform.sh       Tue Nov 09 17:16:16 2004 +0000
@@ -1,6 +1,6 @@
 #! @WRAPPER_SHELL@
 #
-# $NetBSD: gen-transform.sh,v 1.6 2004/11/08 22:29:19 jlam Exp $
+# $NetBSD: gen-transform.sh,v 1.7 2004/11/09 17:16:16 jlam Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -54,7 +54,11 @@
 
 ######################################################################
 # gen action arg
-#       Outputs sed commands that correspond to $action for $arg.
+#      Outputs sed commands that correspond to $action for $arg.  The
+#      "transform" action pertains to transforming command-line options,
+#      while the "untransform" action pertains to unwrapping *-config
+#      files, *.pc files, and *.lai (to-be-installed libtool archive)
+#      files.
 ######################################################################
 gen()
 {
@@ -142,7 +146,14 @@
        ##############################################################
        libpath)
                case $_action in
-               transform|untransform)
+               transform)
+                       $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
+                       $cat << EOF
+s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g
+s|^$1\(/[^$_sep]*\.la\)$|$2\1|g
+EOF
+                       ;;
+               untransform)
                        $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
                        $cat << EOF
 s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g
@@ -199,7 +210,14 @@
        ##############################################################
        opt)
                case $_action in
-               transform|untransform)
+               transform)
+                       $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
+                       $cat << EOF
+s|^$1\([$_sep]\)|$2\1|g
+s|^$1$|$2|g
+EOF
+                       ;;
+               untransform)
                        $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
                        $cat << EOF
 s|\([$_sep]\)$1\([$_sep]\)|\1$2\2|g
@@ -217,7 +235,14 @@
         ###############################################################
        opt-depot)
                case $_action in
-               transform|untransform)
+               transform)
+                       $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
+                       $cat << EOF
+s|^$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|$2\1|g
+s|^$1/[^/$_sep]*\(/[^$_sep]*\)$|$2\1|g
+EOF
+                       ;;
+               untransform)
                        $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
                        $cat << EOF
 s|\([$_sep]\)$1/[^/$_sep]*\(/[^$_sep]*[$_sep]\)|\1$2\2|g
@@ -244,7 +269,14 @@
        ##############################################################
        opt-sub-trailer)
                case $_action in
-               transform|untransform)
+               transform)
+                       $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
+                       $cat << EOF
+s|^$1\(/[^$_sep]*\)$2\([$_sep]\)|$3\1$4|g
+s|^$1\(/[^$_sep]*\)$2$|$3\1$4|g
+EOF
+                       ;;
+               untransform)
                        $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
                        $cat << EOF
 s|\([$_sep]\)$1\(/[^$_sep]*\)$2\([$_sep]\)|\1$3\2$4\3|g
@@ -296,7 +328,14 @@
        ##############################################################
        rm-optarg)
                case $_action in
-               transform|untransform)
+               transform)
+                       $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
+                       $cat << EOF
+s|^$1[^$_sep]*\([$_sep]\)|\1|g
+s|^$1[^$_sep]*$||g
+EOF
+                       ;;
+               untransform)
                        $debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
                        $cat << EOF
 s|\([$_sep]\)$1[^$_sep]*\([$_sep]\)|\1\2|g



Home | Main Index | Thread Index | Old Index