Changeset 36747


Ignore:
Timestamp:
May 14, 2008, 4:53:20 AM (12 years ago)
Author:
jmr@…
Message:

uninstall: allow unforced removal of a port with dependents, iff it is
inactive and there is at least one other version of the same port installed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/registry1.0/portuninstall.tcl

    r36379 r36747  
    6363                set revision [lindex [lindex $ilist 0] 2]
    6464                set variants [lindex [lindex $ilist 0] 3]
     65                set active [lindex [lindex $ilist 0] 4]
    6566        }
    6667
     
    110111                                }
    111112                        } else {
    112                                 ui_msg "$UI_PREFIX [format [msgcat::mc "Unable to uninstall %s %s_%s%s, the following ports depend on it:"] $portname $version $revision $variants]"
    113                                 foreach depport $dl {
    114                                         ui_msg "$UI_PREFIX [format [msgcat::mc "        %s"] $depport]"
    115                                 }
    116                                 if { [info exists uninstall.force] && [string equal ${uninstall.force} "yes"] } {
    117                                         ui_warn "Uninstall forced.  Proceeding despite dependencies."
    118                                 } else {
    119                                         return -code error "Please uninstall the ports that depend on $portname first."
    120                                 }
     113                # will need to change this when we get version/variant dependencies
     114                if {$nb_versions_installed == 1 || $active == 1} {
     115                    ui_msg "$UI_PREFIX [format [msgcat::mc "Unable to uninstall %s %s_%s%s, the following ports depend on it:"] $portname $version $revision $variants]"
     116                    foreach depport $dl {
     117                        ui_msg "$UI_PREFIX [format [msgcat::mc "        %s"] $depport]"
     118                    }
     119                    if { [info exists uninstall.force] && [string equal ${uninstall.force} "yes"] } {
     120                        ui_warn "Uninstall forced.  Proceeding despite dependencies."
     121                    } else {
     122                        return -code error "Please uninstall the ports that depend on $portname first."
     123                    }
     124                }
    121125                        }
    122126                }
Note: See TracChangeset for help on using the changeset viewer.