[106642] trunk/base/src/port1.0/portutil.tcl
jmr at macports.org
jmr at macports.org
Mon Jun 3 00:48:38 PDT 2013
Revision: 106642
https://trac.macports.org/changeset/106642
Author: jmr at macports.org
Date: 2013-06-03 00:48:38 -0700 (Mon, 03 Jun 2013)
Log Message:
-----------
create reinplace's temp files in ${workpath}/.tmp if possible
Modified Paths:
--------------
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2013-06-03 07:29:07 UTC (rev 106641)
+++ trunk/base/src/port1.0/portutil.tcl 2013-06-03 07:48:38 UTC (rev 106642)
@@ -914,7 +914,7 @@
# reinplace
# Provides "sed in place" functionality
proc reinplace {args} {
- global env worksrcpath macosx_version
+ global env workpath worksrcpath macosx_version
set extended 0
set suppress 0
set oldlocale_exists 0
@@ -961,12 +961,18 @@
set pattern [lindex $args 0]
set files [lrange $args 1 end]
+ if {[file isdirectory ${workpath}/.tmp]} {
+ set tempdir ${workpath}/.tmp
+ } else {
+ set tempdir /tmp
+ }
+
foreach file $files {
# if $file is an absolute path already, file join will just return the
# absolute path, otherwise it is $dir/$file
set file [file join $dir $file]
- if {[catch {set tmpfile [mkstemp "/tmp/[file tail $file].sed.XXXXXXXX"]} error]} {
+ if {[catch {set tmpfile [mkstemp "${tempdir}/[file tail $file].sed.XXXXXXXX"]} error]} {
global errorInfo
ui_debug "$errorInfo"
ui_error "reinplace: $error"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130603/d23d3ce8/attachment.html>
More information about the macports-changes
mailing list