Ticket #1324: darwinports.tcl.2.diff

File darwinports.tcl.2.diff, 1.3 KB (added by pguyot (Paul Guyot), 21 years ago)

Patch to darwinports.tcl to glob for receipts with Will's cleanup

  • darwinports.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
    retrieving revision 1.98
    diff -u -r1.98 darwinports.tcl
     
    712712    }
    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
    723735proc dportregistry::fileinfo_for_file {fname} {