New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81289


Ignore:
Timestamp:
07/28/11 19:18:25 (4 years ago)
Author:
cal@…
Message:

rev-upgrade: Implement rebuilding as if one had called port -fn upgrade $broken_port_name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl

    r81272 r81289  
    37523752    array set broken_port_counts {} 
    37533753    while {$run_loop == 1} { 
    3754         if {[catch {revupgrade_scanandrebuild broken_port_counts} run_loop] == 1} { 
    3755             ui_error "An error occured while scanning for broken ports and/or trying to rebuild them" 
    3756             error "An error occured while scanning for broken ports and/or trying to rebuild them" 
    3757         } 
     3754        set run_loop [revupgrade_scanandrebuild broken_port_counts] 
    37583755    } 
    37593756    return 0; 
     
    39313928        } 
    39323929 
     3930        # shared depscache for all ports that are going to be rebuilt 
     3931        array set depscache {} 
     3932        set status 0 
     3933        foreach port $topsort_ports { 
     3934            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]} { 
     3966                    error "Error rebuilding [$port name]" 
     3967                } 
     3968 
     3969            } 
     3970        } 
     3971 
    39333972        return 1; 
    39343973    } 
Note: See TracChangeset for help on using the changeset viewer.