Opened 17 years ago

Closed 15 years ago

#12744 closed defect (fixed)

porttrace does not work if the macports paths contain symbolic links

Reported by: david.osguthorpe@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.6
Component: base Version:
Keywords: porttrace symbolic link Cc: nox@…
Port:

Description

see comments in patch for bug issue if the darwinports destroot path components e.g. /opt or /opt/local/var/db/dports contain symbolic links then porttrace fails all files installed in the destroot the following is a patch which fixes this

This is on Mac OS X 10.3.9

--- porttrace.tcl.orig  Sun Apr 29 13:44:55 2007
+++ porttrace.tcl       Tue Aug 21 11:55:06 2007
@@ -42,6 +42,17 @@
                        ui_warn "trace requires Tcl Thread package ($error)"
                } else {
                        global env trace_fifo trace_sandboxbounds
+                       # major bug - the trace library uses the realpath function to make paths
+                       # fully absolute - removing symbolic links - so we need to ensure
+                       # workpath is also mapped to the actual path if it is a symbolic link
+                       # or any part is a link
+                       # currently only method looks to be to cd to workpath and do a pwd
+                       ui_debug "porttrace: workpath is ${workpath}"
+                       set mycurwd [pwd]
+                       cd $workpath
+                       set realworkpath [pwd]
+                       cd $mycurwd
+                       ui_debug "porttrace: realworkpath is ${realworkpath}"
                        # Create a fifo.
                        set trace_fifo "$workpath/trace_fifo"
                        file delete -force $trace_fifo
@@ -71,7 +82,7 @@
                        # /dev/null
                        # /dev/tty
                        # /Library/Caches/com.apple.Xcode
-                       set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/null:/dev/tty:/Library/Caches/com.apple.Xcode:${workpath}"
+                       set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/null:/dev/tty:/Library/Caches/com.apple.Xcode:${realworkpath}"
                        if {[info exists env(TMPDIR)]} {
                                set trace_sandboxbounds "${trace_sandboxbounds}:$env(TMPDIR)"
                        }

Change History (5)

comment:1 Changed 17 years ago by nox@…

Cc: david.osguthorpe@… nox@… added
Milestone: MacPorts base bugs
Priority: Not setNormal
Summary: porttrace does not work if the darwinports paths contain symbolic linksporttrace does not work if the macports paths contain symbolic links

David, are you really running MacPorts 1.4.42?!

comment:2 Changed 17 years ago by david.osguthorpe@…

No - I guess its 1.42 - but I didnt type this in - this was what the Trac report page has in its version list which seemed to be most reasonable - its the last one before 1.5

comment:3 Changed 16 years ago by nox@…

Version: 1.4.42

comment:4 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:5 Changed 15 years ago by jmroot (Joshua Root)

Cc: david.osguthorpe@… removed
Milestone: MacPorts FutureMacPorts 1.6
Resolution: fixed
Status: newclosed

This appears to have been fixed in r26682.

Note: See TracTickets for help on using tickets.