Ignore:
Timestamp:
Dec 14, 2008, 2:14:00 AM (12 years ago)
Author:
jmr@…
Message:

Apply (manually) gwhitney's dry-run patch from #11892.

File:
1 edited

Legend:

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

    r43571 r43726  
    19411941    # set to no-zero is epoch overrides version
    19421942    set epoch_override 0
     1943    # Is this a dry run?
     1944    set is_dryrun no
     1945    if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} {
     1946        set is_dryrun yes
     1947    }
    19431948
    19441949    # check if the port is in tree
     
    20622067                            || [string compare $variant_installed $variant_active] != 0)} {
    20632068            # deactivate version
    2064             if {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
     2069            if {$is_dryrun eq "yes"} {
     2070                ui_msg "Skipping deactivate $active_name @${version_active}_${revision_active} (dry run)"
     2071            } elseif {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
    20652072                global errorInfo
    20662073                ui_debug "$errorInfo"
     
    20712078        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
    20722079            # activate the latest installed version
    2073             if {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} {
     2080            if {$is_dryrun eq "yes"} {
     2081                ui_msg "Skipping activate $iname @${version_installed}_${revision_installed} (dry run)"
     2082            } elseif {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} {
    20742083                global errorInfo
    20752084                ui_debug "$errorInfo"
     
    22112220        set force_cur [info exists options(ports_force)]
    22122221        set options(ports_force) yes
    2213         if {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant [array get options]} result]} {
     2222        if {$is_dryrun eq "yes"} {
     2223            ui_msg "Skipping uninstall $iname @${version_installed}_$revision_installed$oldvariant (dry run)"
     2224        } elseif {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant [array get options]} result]} {
    22142225            global errorInfo
    22152226            ui_debug "$errorInfo"
     
    22222233    } else {
    22232234        # XXX deactivate version_installed
    2224         if {[catch {portimage::deactivate $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {
     2235        if {$is_dryrun eq "yes"} {
     2236            ui_msg "Skipping deactivate $iname @${version_installed}_$revision_installed (dry run)"
     2237        } elseif {[catch {portimage::deactivate $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {
    22252238            global errorInfo
    22262239            ui_debug "$errorInfo"
     
    22352248    }
    22362249
    2237     if {[catch {set result [mportexec $workername install]} result]} {
     2250    if {$is_dryrun eq "yes"} {
     2251        ui_msg "Skipping activate $portname @${version_in_tree}_$revision_in_tree$oldvariant (dry run)"
     2252    } elseif {[catch {set result [mportexec $workername install]} result]} {
    22382253        global errorInfo
    22392254        ui_debug "$errorInfo"
     
    22442259    if { [info exists uninstall_later] && $uninstall_later == yes } {
    22452260        ui_debug "Uninstalling $iname ${version_installed}_$revision_installed$oldvariant"
    2246         if {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {
     2261        if {$is_dryrun eq "yes"} {
     2262            ui_msg "Skipping uninstall $iname @${version_installed}_$revision_installed$oldvariant (dry run)"
     2263        } elseif {[catch {portuninstall::uninstall $iname ${version_installed}_$revision_installed$oldvariant $optionslist} result]} {
    22472264            global errorInfo
    22482265            ui_debug "$errorInfo"
Note: See TracChangeset for help on using the changeset viewer.