Ticket #1324: portuninstall.tcl.diff

File portuninstall.tcl.diff, 882 bytes (added by pguyot (Paul Guyot), 20 years ago)

Patch to fix the bug by replacing lindex/split with regsub

  • portuninstall.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portuninstall.tcl,v
    retrieving revision 1.30
    diff -u -r1.30 portuninstall.tcl
     
    126126                }
    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                regsub -expanded {^[^-]+-(.*?)(.bz2)?$} $rfile {\1} r_version
     130                        registry_delete $portname $r_version
     131                        return 0
    137132            }
    138133        } else {
    139134            return -code error [msgcat::mc "Uninstall failed: Port has no contents entry"]