Skip to content
Permalink
Browse files

Fix for wbb4's receipt uninstall code.

Bug:            https://trac.macports.org/ticket/1324
Submitted by:   pguyot@kallisys.net and wbb4@opendarwin.org

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@4300 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Jordan K. Hubbard
Jordan K. Hubbard committed Dec 25, 2003
1 parent c6bcaeb commit 2a07b0a544fe36e2e2cf94536f15ebc223003ab9
Showing with 18 additions and 12 deletions.
  1. +16 −4 src/darwinports1.0/darwinports.tcl
  2. +2 −8 src/port1.0/portuninstall.tcl
@@ -712,12 +712,24 @@ proc dportregistry::close {rhandle} {
}
}

proc dportregistry::delete {portname {portversion 1.0}} {
proc dportregistry::delete {portname {portversion 0}} {
global darwinports::registry.path

# Try both versions, just to be sure.
exec rm -f [file join ${darwinports::registry.path} ${portname}-${portversion}]
exec rm -f [file join ${darwinports::registry.path} ${portname}-${portversion}].bz2
# regex match case, as in exists
if {$portversion == 0} {
set x [glob -nocomplain [file join ${darwinports::registry.path} ${portname}-*]]
if {[string length $x]} {
exec rm -f [lindex $x 0]
}
} else {
# Remove the file (with or without .bz2 suffix)
set filename [file join ${darwinports::registry.path} ${portname}-${portversion}]
if { [file exists $filename] } {
exec rm -rf $filename
} elseif { [file exists ${filename}.bz2] } {
exec rm -rf ${filename}.bz2
}
}
}

proc dportregistry::fileinfo_for_file {fname} {
@@ -126,14 +126,8 @@ proc uninstall_main {args} {
}
}
if {!$uninst_err || [tbool uninstall.force]} {
if {[regexp .bz2$ $rfile]} {
regsub {.bz2$} $rfile {} r_file
set r_version [lindex [split $r_file -] 1]
} else {
set r_version [lindex [split $rfile -] 1]
}
registry_delete $portname $r_version
return 0
registry_delete $portname
return 0
}
} else {
return -code error [msgcat::mc "Uninstall failed: Port has no contents entry"]

0 comments on commit 2a07b0a

Please sign in to comment.
You can’t perform that action at this time.