Changeset 81668
- Timestamp:
- 08/03/11 13:33:17 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
r81289 r81668 3114 3114 } 3115 3115 3116 # Is this a rev-upgrade-called run? 3117 set is_revupgrade no 3118 if {[macports::global_option_isset ports_revupgrade]} { 3119 set is_revupgrade yes 3120 } 3121 set is_revupgrade_second_run no 3122 if {[macports::global_option_isset ports_revupgrade_second_run]} { 3123 set is_revupgrade_second_run yes 3124 } 3125 3116 3126 # check if the port is in tree 3117 3127 if {[catch {mportlookup $portname} result]} { … … 3379 3389 } 3380 3390 set will_install no 3391 if {$is_revupgrade} { 3392 set will_install yes 3393 } 3394 if {$is_revupgrade_second_run} { 3395 set build_override 1 3396 } 3381 3397 } 3382 3398 } … … 3384 3400 set will_build no 3385 3401 # avoid building again unnecessarily 3386 if {$will_install && ([info exists options(ports_upgrade_force)] || $build_override == 1 3387 || ![registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)])} { 3402 if {$will_install && 3403 ([info exists options(ports_upgrade_force)] 3404 || $build_override == 1 3405 || ![registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)])} { 3388 3406 set will_build yes 3389 3407 } 3390 3408 3391 3409 # first upgrade dependencies 3392 if {![info exists options(ports_nodeps)] } {3410 if {![info exists options(ports_nodeps)] && !$is_revupgrade} { 3393 3411 set status [_upgrade_dependencies portinfo depscache variationslist options $will_build] 3394 3412 if {$status != 0 && $status != 2 && ![ui_isset ports_processall]} { … … 3933 3951 foreach port $topsort_ports { 3934 3952 if {![info exists depscache(port:[$port name])]} { 3935 array set variations {} 3936 3937 set strindex 0 3938 set variantsstr "[$port variants][$port negated_variants]" 3939 while {$strindex != [string length $variantsstr]} { 3940 set type [string index $variantsstr $strindex] 3941 if {$type != "+" && $type != "-"} { 3942 # ignore char not starting a variant definition 3943 incr $strindex 3944 continue 3945 } 3946 3947 set endpidx [string first "+" $variantsstr $strindex+1] 3948 set endmidx [string first "-" $variantsstr $strindex+1] 3949 set endidx [expr $endpidx < $endmidx ? $endpidx : $endmidx] 3950 3951 if {$endidx != -1} { 3952 set variantname [string trim [string range $variantsstr $strindex+1 $endidx]] 3953 set strindex $endidx 3954 } else { 3955 # end of string 3956 set variantname [string trim [string range $variantsstr $strindex+1 end]] 3957 set strindex [string length $variantsstr] 3958 } 3959 3960 set variations($variantname) $type 3961 } 3962 3963 # make macports::upgrade behave like calling port -f -n upgrade [$port name] 3964 set status [macports::upgrade [$port name] "port:[$port name]" [array get variations] {ports_upgrade_force yes ports_nodeps yes} depscache] 3965 if {$status != 0 && ![macports::ui_isset ports_processall]} { 3953 3954 # convert variations into the format macports::upgrade needs 3955 set minusvariant [lrange [split [$port negated_variants] "-"] 1 end] 3956 set plusvariant [lrange [split [$port variants] "+"] 1 end] 3957 set variants [list] 3958 foreach v $minusvariant { 3959 lappend variants $v "-" 3960 } 3961 foreach v $plusvariant { 3962 lappend variants $v "+" 3963 } 3964 array set variations $variants 3965 3966 set macports::global_options(ports_revupgrade) "yes" 3967 unset -nocomplain macports::global_options(ports_revupgrade_second_run) 3968 if {$broken_port_counts([$port name]) > 1} { 3969 set macports::global_options(ports_revupgrade_second_run) yes 3970 } 3971 3972 # call macports::upgrade with ports_revupgrade option to rebuild the port 3973 set status [macports::upgrade [$port name] "port:[$port name]" \ 3974 [array get variations] [array get macports::global_options] depscache] 3975 if {$status != 0} { 3966 3976 error "Error rebuilding [$port name]" 3967 3977 } 3968 3969 3978 } 3970 3979 }
Note: See TracChangeset
for help on using the changeset viewer.

