New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81272


Ignore:
Timestamp:
07/28/11 09:00:13 (4 years ago)
Author:
cal@…
Message:

rev-upgrade: Repeat scanning and rebuilding until all errors are fixed or a port has been marked as broken more than 3 times.

File:
1 edited

Legend:

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

    r81271 r81272  
    37493749 
    37503750proc macports::revupgrade {args} { 
     3751    set run_loop 1 
     3752    array set broken_port_counts {} 
     3753    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        } 
     3758    } 
     3759    return 0; 
     3760} 
     3761 
     3762# returns 1 if ports were rebuilt and revupgrade_scanandrebuild should be called again 
     3763proc revupgrade_scanandrebuild {broken_port_counts_name} { 
     3764    upvar $broken_port_counts_name broken_port_counts 
     3765 
    37513766    set files [registry::file search active 1 binary -null] 
    37523767    if {[llength $files] > 0} { 
     
    37613776                } 
    37623777            } catch {*} { 
    3763                 ui_msg "Updating database of binaries failed" 
     3778                ui_error "Updating database of binaries failed" 
    37643779                throw 
    37653780            } 
     
    37863801 
    37873802            if {$returncode != $machista::SUCCESS} { 
    3788                 ui_warn "Error parsing file [$b path]: [machista::strerror $returncode]" 
     3803                ui_info "Error parsing file [$b path]: [machista::strerror $returncode]" 
    37893804                continue; 
    37903805            } 
     
    38573872        } 
    38583873        set broken_ports [lsort -unique $broken_ports] 
     3874 
     3875        foreach port $broken_ports { 
     3876            if {![info exists broken_port_counts([$port name])]} { 
     3877                set broken_port_counts([$port name]) 0 
     3878            } 
     3879            incr broken_port_counts([$port name]) 
     3880            if {$broken_port_counts([$port name]) > 3} { 
     3881                ui_error "Port [$port name] is still broken after rebuiling it more than 3 times. You might want to file a bug for this." 
     3882                error "Port [$port name] still broken after rebuilding $broken_port_counts([$port name]) time(s)" 
     3883            } 
     3884        } 
    38593885 
    38603886        ui_msg "---> Found [llength $broken_ports] broken port(s), determining rebuild order" 
     
    39043930            ui_msg "     [$port name] @[$port version] [$port variants][$port negated_variants]" 
    39053931        } 
     3932 
     3933        return 1; 
    39063934    } 
    39073935 
Note: See TracChangeset for help on using the changeset viewer.