[103055] users/cal/base-sqlite-portindex/src/port1.0/portutil.tcl
Joshua Root
jmr at macports.org
Tue Feb 12 14:02:08 PST 2013
> Revision: 103055
> https://trac.macports.org/changeset/103055
> Author: cal at macports.org
> Date: 2013-02-12 10:22:07 -0800 (Tue, 12 Feb 2013)
> Log Message:
> -----------
> make options sets rather than lists (which means no duplicate values allowed), drop support for calling -replace with one option, which was deprecated for a while
>
> Modified Paths:
> --------------
> users/cal/base-sqlite-portindex/src/port1.0/portutil.tcl
>
> Modified: users/cal/base-sqlite-portindex/src/port1.0/portutil.tcl
> ===================================================================
> --- users/cal/base-sqlite-portindex/src/port1.0/portutil.tcl 2013-02-12 18:20:31 UTC (rev 103054)
> +++ users/cal/base-sqlite-portindex/src/port1.0/portutil.tcl 2013-02-12 18:22:07 UTC (rev 103055)
> @@ -65,8 +65,9 @@
> # the Portfile's interpreter and the target's interpreters.
> global $option
> if {[llength $args] > 0} {
> - ui_debug "setting option $option to $args"
> - set $option [lindex $args 0]
> + ui_debug "setting option $option to [lindex $args 0]"
> + set $option {}
> + set_union $option [lindex $args 0]
> }
> return [set $option]
> }
> @@ -84,6 +85,24 @@
> return [info exists $option]
> }
>
> +proc set_union {option args} {
> + global $option
> +
> + foreach val $args {
> + if {[lsearch -exact [set $option] $val] == -1} {
> + lappend $option $val
> + }
> + }
> +}
The implicit assumption here appears to be that passing arguments "foo
bar baz" to a command is exactly equivalent to passing "foo bar foo baz"
in all cases. Unfortunately, that's not the case.
- Josh
More information about the macports-dev
mailing list