pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/wrapper Allow the wrapper-specific transform script...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6118ce84c5f5
branches:  trunk
changeset: 485186:6118ce84c5f5
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Dec 05 03:43:18 2004 +0000

description:
Allow the wrapper-specific transform scripts to replace one arg with
several args by setting split_arg="yes" as part of the transformation.

diffstat:

 mk/wrapper/logic |  36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diffs (76 lines):

diff -r 07f7a4191035 -r 6118ce84c5f5 mk/wrapper/logic
--- a/mk/wrapper/logic  Sun Dec 05 02:47:52 2004 +0000
+++ b/mk/wrapper/logic  Sun Dec 05 03:43:18 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.6 2004/10/08 21:53:53 jlam Exp $
+# $NetBSD: logic,v 1.7 2004/12/05 03:43:18 jlam Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -207,6 +207,7 @@
                *)
                        # Apply transformations to $arg.
                        addtocache=no
+                       split_arg=no
                        case $skip_transform in
                        yes)    
                                $debug_log $wrapperlog "    (logic) to:   $arg [untransformed]"
@@ -231,12 +232,22 @@
                                ;;
                        esac
 
+                       ##############################################
+                       # Split all -l options along whitespace.  This
+                       # disallows library names with whitespace, but it
+                       # allows us to handle transformations that look
+                       # like, e.g. "-lreadline" -> "-ledit -ltermcap".
+                       ##############################################
+                       case $arg in
+                       -l*)    split_arg=yes ;;
+                       esac
+
                        # Re-create the cache file if we're adding to it.
                        case $updatecache,$addtocache in
                        yes,yes)
                                shquote "$arg"; cachedarg="$shquoted"
                                $cat >> $cache_body << EOF
-$cachearg) arg=$cachedarg; cachehit=yes ;;
+$cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;;
 EOF
                                $cat $cache_header \
                                     $cache_body \
@@ -245,23 +256,24 @@
                        esac
                        ;;
                esac
-               case $arg in
+
+               case $split_arg in
                ######################################################
-               # Split -l options along whitespace.  This disallows
-               # library names with whitespace, but it allows us to
-               # handle transformations that look like, e.g.
-               # "-lreadline" -> "-ledit -ltermcap".
+               # Split some options along whitespace.  This disallows
+               # options that contain whitespace, but it allows us to
+               # handle transformations that transform one arg into
+               # several.
                ######################################################
-               -l*)
-                       for lib in $arg; do
-                               append_queue cmdbuf "$lib"
-                               $debug_log $wrapperlog "    (logic) push: $lib"
+               yes)
+                       for i in $arg; do
+                               append_queue cmdbuf "$i"
+                               $debug_log $wrapperlog "    (logic) push: $i"
                        done
                        ;;
                ######################################################
                # Everything else goes into the command buffer unchanged.
                ######################################################
-               *)
+               no)
                        append_queue cmdbuf "$arg"
                        $debug_log $wrapperlog "    (logic) push: $arg"
                        ;;



Home | Main Index | Thread Index | Old Index