Changeset 4300 for trunk/base


Ignore:
Timestamp:
Dec 25, 2003, 9:11:28 AM (20 years ago)
Author:
jkh
Message:

Fix for wbb4's receipt uninstall code.
Bug: 1324
Submitted by: pguyot@… and wbb4@…

Location:
trunk/base/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwinports1.0/darwinports.tcl

    r3306 r4300  
    713713}
    714714
    715 proc dportregistry::delete {portname {portversion 1.0}} {
     715proc dportregistry::delete {portname {portversion 0}} {
    716716    global darwinports::registry.path
    717717
    718     # Try both versions, just to be sure.
    719     exec rm -f [file join ${darwinports::registry.path} ${portname}-${portversion}]
    720     exec rm -f [file join ${darwinports::registry.path} ${portname}-${portversion}].bz2
     718    # regex match case, as in exists
     719    if {$portversion == 0} {
     720                set x [glob -nocomplain [file join ${darwinports::registry.path} ${portname}-*]]
     721                if {[string length $x]} {
     722                    exec rm -f [lindex $x 0]
     723                }
     724        } else {
     725                # Remove the file (with or without .bz2 suffix)
     726                set filename [file join ${darwinports::registry.path} ${portname}-${portversion}]
     727                if { [file exists $filename] } {
     728                        exec rm -rf $filename
     729                } elseif { [file exists ${filename}.bz2] } {
     730                        exec rm -rf ${filename}.bz2
     731                }
     732        }
    721733}
    722734
  • trunk/base/src/port1.0/portuninstall.tcl

    r3954 r4300  
    127127            }
    128128            if {!$uninst_err || [tbool uninstall.force]} {
    129                 if {[regexp .bz2$ $rfile]} {
    130                         regsub {.bz2$} $rfile {} r_file
    131                         set r_version [lindex [split $r_file -] 1]
    132                 } else {
    133                         set r_version [lindex [split $rfile -] 1]
    134                 }
    135                 registry_delete $portname $r_version
    136                 return 0
     129                        registry_delete $portname
     130                        return 0
    137131            }
    138132        } else {
Note: See TracChangeset for help on using the changeset viewer.