[51431] branches/images-and-archives/base/src/port1.0/portimagefile.tcl

blb at macports.org blb at macports.org
Sun May 24 22:40:04 PDT 2009


Revision: 51431
          http://trac.macports.org/changeset/51431
Author:   blb at macports.org
Date:     2009-05-24 22:40:04 -0700 (Sun, 24 May 2009)
Log Message:
-----------
Use TMPDIR when available

Modified Paths:
--------------
    branches/images-and-archives/base/src/port1.0/portimagefile.tcl

Modified: branches/images-and-archives/base/src/port1.0/portimagefile.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portimagefile.tcl	2009-05-25 05:14:02 UTC (rev 51430)
+++ branches/images-and-archives/base/src/port1.0/portimagefile.tcl	2009-05-25 05:40:04 UTC (rev 51431)
@@ -138,8 +138,12 @@
 # it as installed in the MacPorts registry.  This makes no assumptions
 # about how the imagefile was created/acquired
 proc portimagefile::install_register_imagefile {imagefile} {
-    global portimagefilepath prefix
-    set mytempdir [mkdtemp /tmp/mpimageXXXXXXXX]
+    global env portimagefilepath prefix
+    if {[info exists env(TMPDIR)]} {
+        set mytempdir [mkdtemp [file join $env(TMPDIR) mpimageXXXXXXXX]]
+    } else {
+        set mytempdir [mkdtemp [file join tmp mpimageXXXXXXXX]]
+    }
     set startpwd [pwd]
     try {
         if {[catch {_cd $mytempdir} err]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090524/1684df43/attachment.html>


More information about the macports-changes mailing list