<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/59bceb47a4eb7ce3e354069220fbbaeba7544cf3">https://github.com/macports/macports-base/commit/59bceb47a4eb7ce3e354069220fbbaeba7544cf3</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 59bceb4 improve quoting of 'interp eval' args
</span>59bceb4 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 59bceb47a4eb7ce3e354069220fbbaeba7544cf3
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed Nov 30 08:59:01 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> improve quoting of 'interp eval' args
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Having a single argument, preferably braced to guarantee that no
</span><span style='display:block; white-space:pre;color:#404040;'> substitution will happen, reduces the amount of string processing
</span><span style='display:block; white-space:pre;color:#404040;'> and may enable byte compilation in some cases.
</span>---
src/macports1.0/macports.tcl | 87 ++++++++++++++++++++++----------------------
src/macports1.0/reclaim.tcl | 8 ++--
2 files changed, 49 insertions(+), 46 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 7eb96ca..8c9adae 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1308,7 +1308,7 @@ proc macports::worker_init {workername portpath porturl portbuildpath options va
</span> interp hide $workername exit
# cd: This is necessary for some code in port1.0, but should be hidden
<span style='display:block; white-space:pre;background:#ffe0e0;'>- interp eval $workername "rename cd _cd"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ interp eval $workername {rename cd _cd}
</span>
# Tell the sub interpreter about all the Tcl packages we already
# know about so it won't glob for packages.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1320,8 +1320,9 @@ proc macports::worker_init {workername portpath porturl portbuildpath options va
</span> }
# Create package require abstraction procedure
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval "proc PortSystem \{version\} \{ \n\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- package require port \$version \}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {proc PortSystem {version} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ package require port $version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }}
</span>
# Clearly separate slave interpreters and the master interpreter.
$workername alias mport_exec mportexec
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1405,8 +1406,8 @@ proc macports::worker_init {workername portpath porturl portbuildpath options va
</span> global macports::$opt
}
if {[info exists $opt]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set system_options($opt) \{[set $opt]\}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set $opt \{[set $opt]\}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set system_options($opt) \{[set $opt]\}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set $opt \{[set $opt]\}"
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1422,16 +1423,16 @@ proc macports::worker_init {workername portpath porturl portbuildpath options va
</span> # next access will actually define the variable.
$workername eval "trace add variable ::$opt read ::trace_$opt"
# define some value now
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set $opt ?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set $opt ?"
</span> }
foreach {opt val} $options {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set user_options($opt) $val
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set $opt $val
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set user_options($opt) \{$val\}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set $opt \{$val\}"
</span> }
foreach {var val} $variations {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval set variations($var) $val
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval "set variations($var) $val"
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1759,21 +1760,21 @@ proc mportopen {porturl {options {}} {variations {}} {nocache {}}} {
</span>
macports::worker_init $workername $portpath $porturl [macports::getportbuildpath $portpath] $options $variations
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval source Portfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {source Portfile}
</span>
# add the default universal variant if appropriate, and set up flags that
# are conditional on whether universal is set
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval universal_setup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {universal_setup}
</span>
# evaluate the variants
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$workername eval eval_variants variations] != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$workername eval {eval_variants variations}] != 0} {
</span> mportclose $mport
error "Error evaluating variants"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval port::run_callbacks
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {port::run_callbacks}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ditem_key $mport provides [$workername eval return \$subport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ditem_key $mport provides [$workername eval {set subport}]
</span>
return $mport
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1901,13 +1902,13 @@ proc _mportsearchpath {depregex search_path {executable 0} {return_match 0}} {
</span> proc _mportinstalled {mport} {
# Check for the presence of the port in the registry
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [$workername eval registry_exists_for_name \$subport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [$workername eval {registry_exists_for_name $subport}]
</span> }
# Determine if a port is active
proc _mportactive {mport} {
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![catch {set reslist [$workername eval registry_active \$subport]}] && [llength $reslist] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![catch {set reslist [$workername eval {registry_active $subport}]}] && [llength $reslist] > 0} {
</span> set i [lindex $reslist 0]
set name [lindex $i 0]
set version [lindex $i 1]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1952,9 +1953,9 @@ proc _mportispresent {mport depspec} {
</span> set workername [ditem_key $mport workername]
set type [lindex [split $depspec :] 0]
switch -- $type {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lib {return [$workername eval _libtest $depspec]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bin {return [$workername eval _bintest $depspec]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- path {return [$workername eval _pathtest $depspec]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lib {return [$workername eval "_libtest $depspec"]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bin {return [$workername eval "_bintest $depspec"]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ path {return [$workername eval "_pathtest $depspec"]}
</span> port {return 0}
default {return -code error "unknown depspec type: $type"}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2005,10 +2006,10 @@ proc _mportexec {target mport} {
</span> macports::push_log $mport
# xxx: set the work path?
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval validate_macportsuser
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![catch {$workername eval check_variants $target} result] && $result == 0 &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ![catch {$workername eval check_supported_archs} result] && $result == 0 &&
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ![catch {$workername eval eval_targets $target} result] && $result == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {validate_macportsuser}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![catch {$workername eval "check_variants $target"} result] && $result == 0 &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ![catch {$workername eval {check_supported_archs}} result] && $result == 0 &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ![catch {$workername eval "eval_targets $target"} result] && $result == 0} {
</span> # If auto-clean mode, clean-up after dependency install
if {$macports::portautoclean} {
# Make sure we are back in the port path before clean
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2018,7 +2019,7 @@ proc _mportexec {target mport} {
</span> # error since the directory it was in is now gone.
set portpath [ditem_key $mport portpath]
catch {cd $portpath}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval eval_targets clean
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {eval_targets clean}
</span> }
# XXX hack to avoid running out of fds due to sqlite temp files, ticket #24857
interp delete $workername
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2042,9 +2043,9 @@ proc mportexec {mport target} {
</span> set workername [ditem_key $mport workername]
# check for existence of macportsuser and use fallback if necessary
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval validate_macportsuser
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {validate_macportsuser}
</span> # check variants
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$workername eval check_variants $target] != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$workername eval "check_variants $target"] != 0} {
</span> return 1
}
set portname [_mportkey $mport subport]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2059,14 +2060,14 @@ proc mportexec {mport target} {
</span> # supported_archs.
if {[macports::_target_needs_deps $target]} {
# possibly warn or error out depending on how old xcode is
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$workername eval _check_xcode_version] != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$workername eval {_check_xcode_version}] != 0} {
</span> if {$log_needs_pop} {
macports::pop_log
}
return 1
}
# error out if selected arch(s) not supported by this port
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$workername eval check_supported_archs] != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$workername eval {check_supported_archs}] != 0} {
</span> if {$log_needs_pop} {
macports::pop_log
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2080,7 +2081,7 @@ proc mportexec {mport target} {
</span> registry::exclusive_lock
# see if we actually need to build this port
if {$target ni {activate install} ||
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ![$workername eval registry_exists {$subport} {$version} {$revision} {$portvariants}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ![$workername eval {registry_exists $subport $version $revision $portvariants}]} {
</span>
# upgrade dependencies that are already installed
if {![macports::global_option_isset ports_nodeps]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2186,14 +2187,14 @@ proc mportexec {mport target} {
</span> }
# Build this port with the specified target
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set result [$workername eval eval_targets $target]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set result [$workername eval "eval_targets $target"]
</span>
# If auto-clean mode and successful install, clean-up after install
if {$result == 0 && $clean == 1} {
# Make sure we are back in the port path, just in case
set portpath [ditem_key $mport portpath]
catch {cd $portpath}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval eval_targets clean
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {eval_targets clean}
</span> }
global ::logenabled ::debuglogname
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2216,7 +2217,7 @@ proc macports::_upgrade_mport_deps {mport target} {
</span> array set portinfo [mportinfo $mport]
array set depscache {}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set required_archs [$workername eval get_canonical_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set required_archs [$workername eval {get_canonical_archs}]
</span> set depends_skip_archcheck [_mportkey $mport depends_skip_archcheck]
# Pluralize "arch" appropriately.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2229,7 +2230,7 @@ proc macports::_upgrade_mport_deps {mport target} {
</span> continue
}
foreach depspec $portinfo($deptype) {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set dep_portname [$workername eval _get_dep_port $depspec]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dep_portname [$workername eval "_get_dep_port $depspec"]
</span> if {$dep_portname ne "" && ![info exists depscache(port:$dep_portname)] && [$test $dep_portname]} {
set variants {}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3184,7 +3185,7 @@ proc mports_generate_quickindex {index} {
</span>
proc mportinfo {mport} {
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [$workername eval array get ::PortInfo]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [$workername eval {array get ::PortInfo}]
</span> }
proc mportclose {mport} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3275,7 +3276,7 @@ proc mportdepends {mport {target {}} {recurseDeps 1} {skipSatisfied 1} {accDeps
</span> unset -nocomplain optionsarray(subport)
set options [array get optionsarray]
set variations [ditem_key $mport variations]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set required_archs [$workername eval get_canonical_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set required_archs [$workername eval {get_canonical_archs}]
</span> set depends_skip_archcheck [_mportkey $mport depends_skip_archcheck]
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3286,7 +3287,7 @@ proc mportdepends {mport {target {}} {recurseDeps 1} {skipSatisfied 1} {accDeps
</span> }
foreach depspec $portinfo($deptype) {
# get the portname that satisfies the depspec
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set dep_portname [$workername eval _get_dep_port $depspec]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dep_portname [$workername eval "_get_dep_port $depspec"]
</span> # skip port/archs combos we've already seen, and ones with the same port but less archs than ones we've seen (or noarch)
set seenkey ${dep_portname},[join $required_archs ,]
set seen 0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3379,7 +3380,7 @@ proc mportdepends {mport {target {}} {recurseDeps 1} {skipSatisfied 1} {accDeps
</span>
set supported_archs [_mportkey $depport supported_archs]
array unset variation_array
<span style='display:block; white-space:pre;background:#ffe0e0;'>- array set variation_array [[ditem_key $depport workername] eval "array get variations"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ array set variation_array [[ditem_key $depport workername] eval {array get variations}]
</span> mportclose $depport
set arch_mismatch 1
set has_universal 0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3457,7 +3458,7 @@ proc macports::_mport_supports_archs {mport required_archs} {
</span> # return the archs of the given mport
proc macports::_mport_archs {mport} {
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [$workername eval get_canonical_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [$workername eval {get_canonical_archs}]
</span> }
# check if the active version of a port supports the given archs
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3573,7 +3574,7 @@ proc macports::_deptypes_for_target {target workername} {
</span> mdmg -
mpkg {
if {[global_option_isset ports_binary_only] ||
<span style='display:block; white-space:pre;background:#ffe0e0;'>- (![global_option_isset ports_source_only] && [$workername eval _archive_available])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (![global_option_isset ports_source_only] && [$workername eval {_archive_available}])} {
</span> return "depends_lib depends_run"
} else {
return "depends_fetch depends_extract depends_build depends_lib depends_run"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3583,8 +3584,8 @@ proc macports::_deptypes_for_target {target workername} {
</span> activate -
{} {
if {[global_option_isset ports_binary_only] ||
<span style='display:block; white-space:pre;background:#ffe0e0;'>- [$workername eval registry_exists \$subport \$version \$revision \$portvariants]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- || (![global_option_isset ports_source_only] && [$workername eval _archive_available])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [$workername eval {registry_exists $subport $version $revision $portvariants}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ || (![global_option_isset ports_source_only] && [$workername eval {_archive_available}])} {
</span> return "depends_lib depends_run"
} else {
return "depends_fetch depends_extract depends_build depends_lib depends_run"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4008,7 +4009,7 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> # Ideally this would be done in the interp_options when we mportopen,
# but we don't know if we want to do this at that point.
set workername [ditem_key $mport workername]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $workername eval "set force_archive_refresh yes"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $workername eval {set force_archive_refresh yes}
</span>
# run archivefetch and destroot for version_in_tree
# doing this instead of just running install ensures that we have the
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4205,7 +4206,7 @@ proc macports::_upgrade_dependencies {portinfoname depscachename variationslistn
</span> foreach dtype $dtypes {
if {[info exists portinfo($dtype)]} {
foreach i $portinfo($dtype) {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set d [$parentworker eval _get_dep_port $i]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set d [$parentworker eval "_get_dep_port $i"]
</span> if {![llength [array get depscache port:$d]] && ![llength [array get depscache $i]]} {
if {$d ne ""} {
set dspec port:$d
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/reclaim.tcl b/src/macports1.0/reclaim.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 5e4d51c..99d5fa7 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/reclaim.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/reclaim.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -149,9 +149,11 @@ namespace eval reclaim {
</span> set workername [ditem_key $mport workername]
# Append that port's distfiles to the list
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set dist_subdir [$workername eval return {$dist_subdir}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set distfiles [$workername eval return {$distfiles}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set patchfiles [$workername eval [list if {[exists patchfiles]} { return $patchfiles } else { return [list] }]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dist_subdir [$workername eval {set dist_subdir}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set distfiles [$workername eval {set distfiles}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {$workername eval {set patchfiles}} patchfiles]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set patchfiles {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
foreach distfile [concat $distfiles $patchfiles] {
set root_path [file join $root_dist $dist_subdir $distfile]
</pre><pre style='margin:0'>
</pre>