Ticket #11501: uninstall-upgraded.diff

File uninstall-upgraded.diff, 1.9 KB (added by jmroot (Joshua Root), 16 years ago)

proposed fix

  • src/registry1.0/portuninstall.tcl

     
    6262                set version [lindex [lindex $ilist 0] 1]
    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
    6768        # determine if it's the only installed port with that name or not.
     
    109110                                        }
    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                }
    123127        }