Changeset 53715


Ignore:
Timestamp:
Jul 12, 2009, 8:39:09 PM (10 years ago)
Author:
blb@…
Message:

Merge from trunk

Location:
branches/images-and-archives/base
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/images-and-archives/base

  • branches/images-and-archives/base/doc/port.1

    r52360 r53715  
    230230.Ar file
    231231of commands specified by the argument. If the argument is '-', then read commands from stdin. If the option is given multiple times, then multiple files will be read.
    232 .It Fl x
    233 In batch and interactive mode, exit on the first error encountered. Otherwise, errors during batch execution are simply reported.
    234232.It Fl p
    235233Despite any errors encountered, proceed to process multiple ports and commands.
  • branches/images-and-archives/base/src/macports1.0/macports.tcl

    r53504 r53715  
    111111proc macports::ui_init {priority args} {
    112112    # Get the list of channels.
    113     try {
     113    if {[llength [info commands ui_channels]] > 0} {
    114114        set channels [ui_channels $priority]
    115     } catch * {
     115    } else {
    116116        set channels [ui_channels_default $priority]
    117117    }
     
    122122        proc ::ui_$priority {args} {}
    123123    } else {
    124         try {
     124        if {[llength [info commands ui_prefix]] > 0} {
    125125            set prefix [ui_prefix $priority]
    126         } catch * {
     126        } else {
    127127            set prefix [ui_prefix_default $priority]
    128128        }
    129129
    130         try {
     130        if {[llength [info commands ::ui_init]] > 0} {
    131131            eval ::ui_init $priority $prefix $channels $args
    132         } catch * {
     132        } else {
    133133            if {$nbchans == 1} {
    134134                set chan [lindex $channels 0]
     
    18121812                    lappend matches $line
    18131813                    close $fd
    1814                     break
     1814                    set fd -1
    18151815                } catch {*} {
    18161816                    ui_warn "It looks like your PortIndex file may be corrupt."
    1817                     throw
    18181817                } finally {
    1819                     catch {close $fd}
     1818                    if {$fd != -1} {
     1819                        close $fd
     1820                    }
     1821                }
     1822                if {[llength $matches] > 0} {
     1823                    break
    18201824                }
    18211825            }
     
    18471851            continue
    18481852        }
    1849         if {![file exists ${index}.quick] || [file mtime ${index}] > [file mtime ${index}.quick]} {
    1850             # stale or nonexistent quick index file, so generate a new one
     1853        if {![file exists ${index}.quick]} {
     1854            ui_warn "No quick index file found, attempting to generate one for source: $source"
    18511855            if {[catch {set quicklist [mports_generate_quickindex ${index}]}]} {
    18521856                continue
     
    22602264               
    22612265                # upgrade its dependencies first
    2262                 _upgrade_dependencies portinfo depscache globalvarlist variationslist options
     2266                set status [_upgrade_dependencies portinfo depscache globalvarlist variationslist options]
     2267                if {$status != 0 && ![ui_isset ports_processall]} {
     2268                    catch {mportclose $workername}
     2269                    return $status
     2270                }
    22632271                # now install it
    22642272                if {[catch {set result [mportexec $workername install]} result]} {
     
    22882296        } else {
    22892297            ui_error "Checking installed version failed: $result"
    2290             exit 1
     2298            return 1
    22912299        }
    22922300    } else {
     
    24062414    # first upgrade dependencies
    24072415    if {![info exists options(ports_nodeps)]} {
    2408         _upgrade_dependencies portinfo depscache globalvarlist variationslist options
     2416        set status [_upgrade_dependencies portinfo depscache globalvarlist variationslist options]
     2417        if {$status != 0 && ![ui_isset ports_processall]} {
     2418            catch {mportclose $workername}
     2419            return $status
     2420        }
    24092421    } else {
    24102422        ui_debug "Not following dependencies"
     
    24352447                        set mpname [lindex $dep 2]
    24362448                        if {![llength [array get depscache port:${mpname}]]} {
    2437                             macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache
     2449                            set status [macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache]
     2450                            if {$status != 0 && ![ui_isset ports_processall]} {
     2451                                catch {mportclose $workername}
     2452                                return $status
     2453                            }
    24382454                        }
    24392455                    }
     
    25452561                set mpname [lindex $dep 2]
    25462562                if {![llength [array get depscache port:${mpname}]]} {
    2547                     macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache
     2563                    set status [macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache]
     2564                    if {$status != 0 && ![ui_isset ports_processall]} {
     2565                        catch {mportclose $workername}
     2566                        return $status
     2567                    }
    25482568                }
    25492569            }
     
    25542574    # close the port handle
    25552575    mportclose $workername
     2576    return 0
    25562577}
    25572578
     
    25762597    unset -nocomplain options(ports_do_dependents)
    25772598
     2599    set status 0
    25782600    # each dep type is upgraded
    25792601    foreach dtype {depends_fetch depends_extract depends_build depends_lib depends_run} {
     
    25822604                set d [lindex [split $i :] end]
    25832605                if {![llength [array get depscache port:${d}]] && ![llength [array get depscache $i]]} {
    2584                     upgrade $d $i $globalvarlist $variationslist [array get options] depscache
    2585                 }
    2586             }
    2587         }
     2606                    set status [upgrade $d $i $globalvarlist $variationslist [array get options] depscache]
     2607                    if {$status != 0 && ![ui_isset ports_processall]} break
     2608                }
     2609            }
     2610        }
     2611        if {$status != 0 && ![ui_isset ports_processall]} break
    25882612    }
    25892613    # restore dependent-following to its former value
     
    25912615        set options(ports_do_dependents) yes
    25922616    }
     2617    return $status
    25932618}
    25942619
  • branches/images-and-archives/base/src/port/port.tcl

    r53681 r53715  
    13421342        }
    13431343    }
     1344    return 0
    13441345}
    13451346
     
    17191720    }
    17201721
     1722    set status 0
    17211723    foreachport $portlist {
    17221724        if {$porturl eq ""} {
     
    17791781        }
    17801782    }
     1783    return $status
    17811784}
    17821785
     
    19951998    # shared depscache for all ports in the list
    19961999    array set depscache {}
     2000    set status 0
    19972001    foreachport $portlist {
    19982002        if {![registry::entry_exists_for_name $portname]} {
    1999             ui_error "$portname is not installed"
    2000             return 1
     2003            break_softcontinue "$portname is not installed" 1 status
    20012004        }
    20022005        if {![info exists depscache(port:$portname)]} {
     
    20092012            set variations_list [mport_filtervariants [array get requested_variations] yes]
    20102013           
    2011             macports::upgrade $portname "port:$portname" $global_variations_list $variations_list [array get options] depscache
    2012         }
    2013     }
    2014 
    2015     return 0
     2014            set status [macports::upgrade $portname "port:$portname" $global_variations_list $variations_list [array get options] depscache]
     2015            if {$status != 0 && ![macports::ui_isset ports_processall]} {
     2016                return $status
     2017            }
     2018        }
     2019    }
     2020
     2021    return $status
    20162022}
    20172023
     
    20372043    registry::open_dep_map
    20382044
     2045    set status 0
    20392046    foreachport $portlist {
    20402047        set composite_version [composite_version $portversion [array get variations]]
     
    20642071        }
    20652072    }
    2066     return 0
     2073    return $status
    20672074}
    20682075
     
    20822089
    20832090    foreachport $portlist {
     2091        if {![registry::entry_exists_for_name $portname]} {
     2092            ui_info "$portname is already uninstalled"
     2093            continue
     2094        }
    20842095        if { [catch {portuninstall::uninstall $portname [composite_version $portversion [array get variations]] [array get options]} result] } {
    20852096            global errorInfo
     
    20892100    }
    20902101
    2091     return 0
     2102    return $status
    20922103}
    20932104
     
    31933204                        set ui_options(ports_processall) yes
    31943205                    }
    3195                     x {
    3196                         # Exit with error from any command while in batch/interactive mode
    3197                         set ui_options(ports_exit) yes
    3198                     }
    3199 
    32003206                    f {
    32013207                        set global_options(ports_force) yes
     
    32633269
    32643270    # Process an action if there is one
    3265     while {$action_status == 0 && [moreargs]} {
     3271    while {($action_status == 0 || [macports::ui_isset ports_processall]) && [moreargs]} {
    32663272        set action [lookahead]
    32673273        advance
     
    33463352        # semaphore to exit
    33473353        if {$action_status == -999} break
    3348 
    3349         # If we're not in exit mode then ignore the status from the command
    3350         if { ![macports::ui_isset ports_exit] } {
    3351             set action_status 0
    3352         }
    33533354    }
    33543355   
     
    34733474    # Main command loop
    34743475    set exit_status 0
    3475     while { $exit_status == 0 } {
     3476    while { $exit_status == 0 || [macports::ui_isset ports_processall] } {
    34763477
    34773478        # Calculate our prompt
     
    34933494       
    34943495        # Check for semaphore to exit
    3495         if {$exit_status == -999} break
    3496        
    3497         # Ignore status unless we're in error-exit mode
    3498         if { ![macports::ui_isset ports_exit] } {
     3496        if {$exit_status == -999} {
    34993497            set exit_status 0
     3498            break
    35003499        }
    35013500    }
     
    35393538        }
    35403539
    3541         # Check for semaphore to exit
    3542         if {$exit_status == -999} {
    3543             set exit_status 0
    3544             break
    3545         }
    3546 
    3547         # Ignore status unless we're in error-exit mode
    3548         if { ![macports::ui_isset ports_exit] } {
    3549             set exit_status 0
     3540        # Exit on first failure unless -p was given
     3541        if {$exit_status != 0 && ![macports::ui_isset ports_processall]} {
     3542            return $exit_status
    35503543        }
    35513544    }
     
    36333626
    36343627    # If there are remaining arguments, process those as a command
    3635 
    3636     # Exit immediately, by default, unless we're going to be processing command files
    3637     if {![info exists ui_options(ports_commandfiles)]} {
    3638         set ui_options(ports_exit) yes
    3639     }
    36403628    set exit_status [process_cmd $remaining_args]
    36413629}
    36423630
    36433631# Process any prescribed command files, including standard input
    3644 if { $exit_status == 0 && [info exists ui_options(ports_commandfiles)] } {
     3632if { ($exit_status == 0 || [macports::ui_isset ports_processall]) && [info exists ui_options(ports_commandfiles)] } {
    36453633    set exit_status [process_command_files $ui_options(ports_commandfiles)]
    36463634}
  • branches/images-and-archives/base/src/port1.0/portutil.tcl

    r53504 r53715  
    15741574        }
    15751575        if {!([info exists ports_ignore_older] && $ports_ignore_older == "yes") && [file mtime $statefile] < [file mtime ${portpath}/Portfile]} {
    1576             ui_msg "Portfile changed since last build; discarding previous state."
    1577             #file delete $statefile
    1578             delete [file join $workpath]
    1579             file mkdir [file join $workpath]
     1576            if {!([info exists ports_dryrun] && $ports_dryrun == "yes")} {
     1577                ui_msg "Portfile changed since last build; discarding previous state."
     1578                delete [file join $workpath]
     1579                file mkdir [file join $workpath]
     1580            } else {
     1581                ui_msg "Portfile changed since last build but not discarding previous state (dry run)"
     1582            }
    15801583        }
    15811584    }
  • branches/images-and-archives/base/src/registry1.0/registry.tcl

    r52366 r53715  
    438438        }
    439439       
    440     if {$v != ""} {
    441         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
    442     } else {
    443         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
    444     }
    445 
     440        # if another version of this port is active, deactivate it first
    446441        set ilist [registry::installed $name]
    447442        if { [llength $ilist] > 1 } {
     
    453448                        set iactive [lindex $i 4]
    454449                        if { ![string equal ${iversion}_${irevision}${ivariants} ${version}_${revision}${variants}] && $iactive == 1 } {
    455                                 return -code error "Image error: Another version of this port ($iname @${iversion}_${irevision}${ivariants}) is already active."
     450                                deactivate $iname ${iversion}_${irevision}${ivariants} $optionslist
    456451                        }
    457452                }
     453        }
     454
     455        if {$v != ""} {
     456                ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
     457        } else {
     458                ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
    458459        }
    459460
Note: See TracChangeset for help on using the changeset viewer.