Revision
140676
Author
jmr@macports.org
Date
2015-09-29 20:38:56 -0700 (Tue, 29 Sep 2015)

Log Message

follow-up to r129924: use realpath in porttrace::appendEntry instead of reimplementing it

Modified Paths

Diff

Modified: trunk/base/src/port1.0/porttrace.tcl (140675 => 140676)


--- trunk/base/src/port1.0/porttrace.tcl	2015-09-30 03:30:54 UTC (rev 140675)
+++ trunk/base/src/port1.0/porttrace.tcl	2015-09-30 03:38:56 UTC (rev 140676)
@@ -67,29 +67,15 @@
         # Escape equal signs with \=
         lappend mapping "=" "\\="
 
-        set normalizedPath [file normalize $path]
         # file normalize will leave symlinks as the very last
         # path component intact. This will, for instance, prevent /tmp from
         # being resolved to /private/tmp.
-        # Also use file readlink to counter this behavior.
-        # file readlink returns an error, if the last component is not
-        # a symlink. Catch that.
-        set resolvedPath {}
-        if {![catch {file readlink $path}]} {
-          set resolvedPath [file readlink $path]
-
-          if {[string length $resolvedPath] > 0 && [string index $resolvedPath 0] ne "/"} {
-              # Canonicalize.
-              set resolvedPath [file normalize [file dirname $path]/$resolvedPath]
-          }
-        }
+        # Use realpath to avoid this behavior.
+        set normalizedPath [realpath $path]
         lappend sndbxlst "[string map $mapping $path]=$action"
         if {$normalizedPath ne $path} {
             lappend sndbxlst "[string map $mapping $normalizedPath]=$action"
         }
-        if {[string length $resolvedPath] > 0 && $resolvedPath ne $path} {
-            lappend sndbxlst "[string map $mapping $resolvedPath]=$action"
-        }
     }
 
     ##