[140682] trunk/base/src/port1.0/porttrace.tcl

jmr at macports.org jmr at macports.org
Tue Sep 29 23:02:47 PDT 2015


Revision: 140682
          https://trac.macports.org/changeset/140682
Author:   jmr at macports.org
Date:     2015-09-29 23:02:47 -0700 (Tue, 29 Sep 2015)
Log Message:
-----------
avoid error due to calling realpath on nonexistent files

Modified Paths:
--------------
    trunk/base/src/port1.0/porttrace.tcl

Modified: trunk/base/src/port1.0/porttrace.tcl
===================================================================
--- trunk/base/src/port1.0/porttrace.tcl	2015-09-30 05:50:10 UTC (rev 140681)
+++ trunk/base/src/port1.0/porttrace.tcl	2015-09-30 06:02:47 UTC (rev 140682)
@@ -71,7 +71,11 @@
         # path component intact. This will, for instance, prevent /tmp from
         # being resolved to /private/tmp.
         # Use realpath to avoid this behavior.
-        set normalizedPath [realpath $path]
+        set normalizedPath [file normalize $path]
+        # realpath only works on files that exist
+        if {![catch {file type $normalizedPath}]} {
+            set normalizedPath [realpath $normalizedPath]
+        }
         lappend sndbxlst "[string map $mapping $path]=$action"
         if {$normalizedPath ne $path} {
             lappend sndbxlst "[string map $mapping $normalizedPath]=$action"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150929/05802a99/attachment.html>


More information about the macports-changes mailing list