Opened 17 years ago

Closed 14 years ago

#12420 closed defect (fixed)

port uninstall fails with { or } in filenames

Reported by: simon@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.9.0
Component: base Version: 1.5.0
Keywords: Cc: simon@…
Port:

Description

Hi,

I just tried installing a new port for macports and everything worked fine but I couldn't uninstall the port anymore. port uninstall failed with the following error:

--->  Uninstalling NicePlayer 0.95_0
DEBUG: list element in braces followed by ".scpt)" instead of space
    while executing
"llength $sumx"
    (procedure "portuninstall::uninstall" line 117)
    invoked from within
"portuninstall::uninstall $portname [composite_version $portversion [array get variations]] [array get options]"
Error: port uninstall failed: list element in braces followed by ".scpt)" instead of space

But activating and deactivating the port works fine, so the problem must be in the port uninstall part of macports.

After some digging I found one of problematic files:

01 Stretch Aspect Ratio/01 To 16-9 {^*L}.scpt

The problem is the { and } in the filename. After some more digging in the ports tcl code I found a solution which works for me, but I don't think my solution is very good because I don't have any Tcl programming skills (just starting with Tcl).

I don't know if it brakes anything else so it should be tested before it's used (if it works for others as well).

--- share/macports/Tcl/registry1.0/portuninstall.tcl	2007-08-09 23:30:58.000000000 +0200
+++ share/macports/Tcl/registry1.0/portuninstall.tcl	2007-08-09 23:31:23.000000000 +0200
@@ -154,6 +154,9 @@
 				# return a checksum error
 				set sumx {}
 			}
+			
+			set sumx [regsub "\}" [regsub "\{" $sumx "\\\{"] "\\\}"]
+			
 			set sum1 [lindex $sumx [expr [llength $sumx] - 1]]
 			if {![string match $sum1 NONE] && ![info exists uninstall.nochecksum] && ![string equal -nocase $uninstall.nochecksum "yes"] } {
 				if {![catch {set sum2 [md5 $fname]}]} {

I think somewhere is the escaping of { and } in filenames missed during the uninstall phase, because with activate and deactivate it works fine (these files are listed for example with port -d activate).

Hope this helps, Simon

Change History (3)

comment:1 Changed 17 years ago by simon@…

Cc: simon@… added; simon@… removed

comment:2 Changed 16 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:3 Changed 14 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 1.9.0
Resolution: fixed
Status: newclosed

Can't reproduce this; I assume it was fixed in the switch to the sqlite registry.

Note: See TracTickets for help on using tickets.