Changeset 54425


Ignore:
Timestamp:
Jul 27, 2009, 1:39:11 PM (9 years ago)
Author:
jmr@…
Message:

upgrade: don't bother checking whether variants are provided by the port, which also allows things to happen in a slightly more sensible order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/macports.tcl

    r54378 r54425  
    24252425    set oldvariantlist [mport_filtervariants $oldvariantlist no]
    24262426
     2427    # merge in the old variants
     2428    foreach {variation value} $oldvariantlist {
     2429        if { ![info exists variations($variation)]} {
     2430            set variations($variation) $value
     2431        }
     2432    }
     2433
     2434    # Now merge in the global (i.e. variants.conf) variations.
     2435    # We wait until now so that existing variants for this port
     2436    # override global variations
     2437    foreach { variation value } $globalvarlist {
     2438        if { ![info exists variations($variation)] } {
     2439            set variations($variation) $value
     2440        }
     2441    }
     2442
     2443    ui_debug "new fully merged portvariants: [array get variations]"
     2444   
    24272445    # at this point we need to check if a different port will be replacing this one
    24282446    if {[info exists portinfo(replaced_by)] && ![info exists options(ports_upgrade_no-replace)]} {
     
    24412459        array set portinfo [lindex $result 1]
    24422460        set newname $portinfo(name)
    2443         set version_in_tree "$portinfo(version)"
    24442461
    24452462        set porturl $portinfo(porturl)
     
    24512468        set newname $portname
    24522469    }
    2453 
    2454     # check if the variants are present in $version_in_tree
    2455     if {[info exists portinfo(variants)]} {
    2456         set avariants $portinfo(variants)
    2457     } else {
    2458         set avariants {}
    2459     }
    2460     ui_debug "available variants are : $avariants"
    2461     foreach {variation value} $oldvariantlist {
    2462         if {[lsearch $avariants $variation] != -1} {
    2463             ui_debug "variant $variation is present in $newname $version_in_tree"
    2464             if { ![info exists variations($variation)]} {
    2465                 set variations($variation) $value
    2466             }
    2467         }
    2468     }
    2469 
    2470     # Now merge in the global (i.e. variants.conf) variations.
    2471     # We wait until now so that existing variants for this port
    2472     # override global variations
    2473     foreach { variation value } $globalvarlist {
    2474         if { ![info exists variations($variation)] } {
    2475             set variations($variation) $value
    2476         }
    2477     }
    2478 
    2479     ui_debug "new fully merged portvariants: [array get variations]"
    24802470
    24812471    if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
Note: See TracChangeset for help on using the changeset viewer.