[53670] trunk/base/src/port/port.tcl
jmr at macports.org
jmr at macports.org
Sat Jul 11 08:08:45 PDT 2009
Revision: 53670
http://trac.macports.org/changeset/53670
Author: jmr at macports.org
Date: 2009-07-11 08:08:45 -0700 (Sat, 11 Jul 2009)
Log Message:
-----------
Distinguish variants that the user requested (e.g. on the command line) from existing ones pulled from the registry. Fixes #19961.
Modified Paths:
--------------
trunk/base/src/port/port.tcl
Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2009-07-11 14:57:43 UTC (rev 53669)
+++ trunk/base/src/port/port.tcl 2009-07-11 15:08:45 UTC (rev 53670)
@@ -260,6 +260,7 @@
# name
# version (version_revision)
# variants array (variant=>+-)
+ # requested_variants array (variant=>+-)
# options array (key=>value)
# fullname (name/version_revision+-variants)
@@ -268,6 +269,7 @@
if {![info exists port(name)]} { set port(name) "" }
if {![info exists port(version)]} { set port(version) "" }
if {![info exists port(variants)]} { set port(variants) "" }
+ if {![info exists port(requested_variants)]} { set port(requested_variants) "" }
if {![info exists port(options)]} { set port(options) [array get global_options] }
# If neither portname nor url is specified, then default to the current port
@@ -300,7 +302,8 @@
foreach portentry $ports {
array set port $portentry
if ([info exists overrides(version)]) { set port(version) $overrides(version) }
- if ([info exists overrides(variants)]) { set port(variants) $overrides(variants) }
+ if ([info exists overrides(variants)]) { set port(variants) $overrides(variants) }
+ if ([info exists overrides(requested_variants)]) { set port(requested_variants) $overrides(requested_variants) }
if ([info exists overrides(options)]) { set port(options) $overrides(options) }
add_to_portlist portlist [array get port]
}
@@ -364,6 +367,8 @@
set portversion $portspec(version)
array unset variations
array set variations $portspec(variants)
+ array unset requested_variations
+ array set requested_variations $portspec(requested_variants)
array unset options
array set options $portspec(options)
}
@@ -880,7 +885,7 @@
set url ""
set name ""
set version ""
- array unset variants
+ array unset requested_variants
array unset options
set token [lookahead]
@@ -974,11 +979,12 @@
advance
set name [url_to_portname $token]
if {$name != ""} {
- parsePortSpec version variants options
+ parsePortSpec version requested_variants options
add_to_portlist reslist [list url $token \
name $name \
version $version \
- variants [array get variants] \
+ requested_variants [array get requested_variants] \
+ variants [array get requested_variants] \
options [array get options]]
} else {
ui_error "Can't open URL '$token' as a port"
@@ -989,11 +995,12 @@
default { # Treat anything else as a portspec (portname, version, variants, options
# or some combination thereof).
- parseFullPortSpec url name version variants options
+ parseFullPortSpec url name version requested_variants options
add_to_portlist reslist [list url $url \
name $name \
version $version \
- variants [array get variants] \
+ requested_variants [array get requested_variants] \
+ variants [array get requested_variants] \
options [array get options]]
set el 1
}
@@ -1013,7 +1020,12 @@
array unset overrides
if {$version != ""} { set overrides(version) $version }
- if {[array size variants]} { set overrides(variants) [array get variants] }
+ if {[array size variants]} {
+ # we always record the requested variants separately,
+ # but requested ones always override existing ones
+ set overrides(requested_variants) [array get variants]
+ set overrides(variants) [array get variants]
+ }
if {[array size options]} { set overrides(options) [array get options] }
add_ports_to_portlist reslist $ports [array get overrides]
@@ -1995,7 +2007,7 @@
# First filter out implicit variants from the explicitly set/unset variants.
set global_variations_list [mport_filtervariants [array get global_variations] yes]
- set variations_list [mport_filtervariants [array get variations] yes]
+ set variations_list [mport_filtervariants [array get requested_variations] yes]
macports::upgrade $portname "port:$portname" $global_variations_list $variations_list [array get options] depscache
}
@@ -2827,12 +2839,13 @@
set porturl $portinfo(porturl)
}
- # Add any global_variations to the variations
- # specified for the port
- foreach { variation value } [array get global_variations] {
- if { ![info exists variations($variation)] } {
- set variations($variation) $value
- }
+ # use existing variants iff none were explicitly requested
+ if {[array get requested_variations] == "" && [array get variations] != ""} {
+ array unset requested_variations
+ array set requested_variations [array get variations]
+ set filtered_variations [mport_filtervariants [array get variations] no]
+ } else {
+ set filtered_variations [mport_filtervariants [array get requested_variations] yes]
}
# Filter out implicit variants from the explicitly set/unset variants.
# Except we need to keep them for some targets to work right...
@@ -2840,18 +2853,25 @@
distfiles -
mirror {}
default {
- set variationslist [mport_filtervariants [array get variations] yes]
- array unset variations
- array set variations $variationslist
+ array unset requested_variations
+ array set requested_variations $filtered_variations
}
}
+
+ # Add any global_variations to the variations
+ # specified for the port
+ foreach { variation value } [array get global_variations] {
+ if { ![info exists requested_variations($variation)] } {
+ set requested_variations($variation) $value
+ }
+ }
# If version was specified, save it as a version glob for use
# in port actions (e.g. clean).
if {[string length $portversion]} {
set options(ports_version_glob) $portversion
}
- if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+ if {[catch {set workername [mportopen $porturl [array get options] [array get requested_variations]]} result]} {
global errorInfo
ui_debug "$errorInfo"
break_softcontinue "Unable to open port: $result" 1 status
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090711/8d1b2aef/attachment-0001.html>
More information about the macports-changes
mailing list