[48384] trunk/base/src/port1.0/portutil.tcl

raimue at macports.org raimue at macports.org
Fri Mar 20 09:52:08 PDT 2009


Revision: 48384
          http://trac.macports.org/changeset/48384
Author:   raimue at macports.org
Date:     2009-03-20 09:52:08 -0700 (Fri, 20 Mar 2009)
Log Message:
-----------
port1.0/portutil.tcl:
New handle_option-replace proc which allows to apply strsed on an option

Modified Paths:
--------------
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2009-03-20 16:43:36 UTC (rev 48383)
+++ trunk/base/src/port1.0/portutil.tcl	2009-03-20 16:52:08 UTC (rev 48384)
@@ -129,6 +129,23 @@
     }
 }
 
+##
+# Handle option-replace
+#
+# @param option name of the option
+# @param args arguments
+proc handle_option-replace {option args} {
+    global $option user_options option_procs
+
+    if {![info exists user_options($option)] && [info exists $option]} {
+        set temp [set $option]
+        foreach val $args {
+            set temp [strsed $temp $val]
+        }
+        set $option $temp
+    }
+}
+
 # options
 # Exports options in an array as externally callable procedures
 # Thus, "options name date" would create procedures named "name"
@@ -141,6 +158,7 @@
         interp alias {} $option {} handle_option $option
         interp alias {} $option-append {} handle_option-append $option
         interp alias {} $option-delete {} handle_option-delete $option
+        interp alias {} $option-replace {} handle_option-replace $option
     }
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090320/cc964102/attachment.html>


More information about the macports-changes mailing list