<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/80ff3eda1043d5bf7eb48fa28f4720795cf271e7">https://github.com/macports/macports-base/commit/80ff3eda1043d5bf7eb48fa28f4720795cf271e7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 80ff3eda1043d5bf7eb48fa28f4720795cf271e7
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Dec 2 16:13:34 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> Remove method_wrap from macports_util
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> I can't see any good reason for what it's doing, so it appears to be
</span><span style='display:block; white-space:pre;color:#404040;'> just adding overhead.
</span>---
src/macports1.0/macports_util.tcl | 38 --------------------------------
src/macports1.0/tests/macports_util.test | 23 -------------------
2 files changed, 61 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports_util.tcl b/src/macports1.0/macports_util.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 4cb9e16..04e0996 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports_util.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports_util.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -87,39 +87,6 @@ namespace eval macports_util {
</span>
return $result
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- proc method_wrap {name} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- variable argdefault
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set name [list $name]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # reconstruct the args list
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set args [uplevel 1 [subst -nocommands {info args $name}]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set arglist {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach arg $args {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set argname [list $arg]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[uplevel 1 [subst -nocommands {info default $name $argname argdefault}]]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend arglist [list $arg $argdefault]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend arglist $arg
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # modify the proc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set arglist [list $arglist]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set body [uplevel 1 [subst -nocommands {info body $name}]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uplevel 1 [subst -nocommands {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- proc $name $arglist {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[set err [catch {$body} result]] && [set err] != 2} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[set err] == 1} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code [set err] -errorcode [set ::errorCode] [set result]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code [set err] [set result]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return [set result]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> }
###################
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -175,7 +142,6 @@ proc ldindex {varName args} {
</span> }
return $item
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-macports_util::method_wrap ldindex
</span>
# lpop varName
# Removes the last list element from a variable
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -188,7 +154,6 @@ proc lpop {varName} {
</span> }
return {}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-macports_util::method_wrap lpop
</span>
# lpush varName ?value ...?
# Appends list elements onto a variable
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -198,7 +163,6 @@ proc lpush {varName args} {
</span> upvar 1 $varName var
lappend var {*}$args
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-macports_util::method_wrap lpush
</span>
# lshift varName
# Removes the first list element from a variable
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -211,7 +175,6 @@ proc lshift {varName} {
</span> }
return {}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-macports_util::method_wrap lshift
</span>
# lunshift varName ?value ...?
# Prepends list elements onto a variable
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -223,7 +186,6 @@ proc lunshift {varName args} {
</span> }
set var [list {*}$args {*}$var]
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-macports_util::method_wrap lunshift
</span>
# bytesize filesize ?unit? ?format?
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/tests/macports_util.test b/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;color:#808080;'>index d39afb9..3360858 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,29 +7,6 @@ source ../macports_test_autoconf.tcl
</span> package require macports 1.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-test method_wrap {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Method wrap unit test.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} -setup {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- proc test_proc {a} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if { $a == 1} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error $a -errorcode 7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} -body {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- macports_util::method_wrap test_proc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[test_proc 1] != 7} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: no wrap around method"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[test_proc arg] ne "arg"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: no wrap around method"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "Method wrap successful."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} -result "Method wrap successful."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> test unobscure_maintainers_github {
Test macports::unobscure_maintainers with a GitHub handle
} -body {
</pre><pre style='margin:0'>
</pre>