[25067] branches/dp2mp-move/base/src/port1.0
source_changes at macosforge.org
source_changes at macosforge.org
Sat May 12 23:42:48 PDT 2007
Revision: 25067
http://trac.macosforge.org/projects/macports/changeset/25067
Author: jmpp at macports.org
Date: 2007-05-12 23:42:48 -0700 (Sat, 12 May 2007)
Log Message:
-----------
Merge Eridius' r25006: Fix the -delete proc to handle multiple arguments properly. This was entirely my fault. Fixes #11929.
Modified Paths:
--------------
branches/dp2mp-move/base/src/port1.0/portutil.tcl
branches/dp2mp-move/base/src/port1.0/tests/portutil.tcl
Modified: branches/dp2mp-move/base/src/port1.0/portutil.tcl
===================================================================
--- branches/dp2mp-move/base/src/port1.0/portutil.tcl 2007-05-13 06:41:35 UTC (rev 25066)
+++ branches/dp2mp-move/base/src/port1.0/portutil.tcl 2007-05-13 06:42:48 UTC (rev 25067)
@@ -99,9 +99,9 @@
proc ${option}-delete {args} [subst -nocommands {
global $option user_options option_procs
if {![info exists user_options($option)] && [info exists $option]} {
- set temp $option
+ set temp [set $option]
foreach val \$args {
- set temp [ldelete \${$option} \$val]
+ set temp [ldelete \$temp \$val]
}
if {\$temp eq ""} {
unset $option
Modified: branches/dp2mp-move/base/src/port1.0/tests/portutil.tcl
===================================================================
--- branches/dp2mp-move/base/src/port1.0/tests/portutil.tcl 2007-05-13 06:41:35 UTC (rev 25066)
+++ branches/dp2mp-move/base/src/port1.0/tests/portutil.tcl 2007-05-13 06:42:48 UTC (rev 25067)
@@ -59,6 +59,36 @@
}
}
+proc test_depends_lib-delete {} {
+ # tests depends_lib-delete
+ # actually tests all option-deletes
+ # but the bug was originally documented with depends_lib
+
+ # depends_lib is intended to work from within a worker thread
+ # so we shall oblige
+ set workername [interp create]
+ darwinports::worker_init $workername {} [darwinports::getportbuildpath {}] {} {}
+ set body {
+ # load the current copy of portutil instead of the installed one
+ source [file dirname [info script]]/../portutil.tcl
+ package require port
+
+ depends_lib port:foo port:bar port:blah
+ depends_lib-delete port:blah port:bar
+ array get PortInfo
+ }
+ if {[catch {$workername eval $body} result]} {
+ interp delete $workername
+ error $result $::errorInfo $::errorCode
+ } else {
+ interp delete $workername
+ }
+ array set temp $result
+ if {$temp(depends_lib) ne "port:foo"} {
+ error "depends_lib-delete did not delete properly"
+ }
+}
+
proc test_touch {} {
set root "/tmp/macports-portutil-touch"
file delete -force $root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070512/1bc7e0f6/attachment.html
More information about the macports-changes
mailing list