Whitespace and config values

Bryan Blackburn blb at macports.org
Fri Feb 13 01:44:41 PST 2009


Does anyone see any issue with the attached patch?  It seems that parsing
macports.conf will leave trailing whitespace on values, hence some things
won't match "yes" because they are "yes	" (see ticket #18460).  I ask in
case someone is aware of any possible reason to keep trailing whitespace
within values...

Bryan

-------------- next part --------------
Index: src/macports1.0/macports.tcl
===================================================================
--- src/macports1.0/macports.tcl	(revision 46782)
+++ src/macports1.0/macports.tcl	(working copy)
@@ -380,7 +380,7 @@
             while {[gets $fd line] >= 0} {
                 if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
                     if {[lsearch $bootstrap_options $option] >= 0} {
-                        set macports::$option $val
+                        set macports::$option [string trim $val]
                         global macports::$option
                     }
                 }


More information about the macports-dev mailing list