[41701] trunk/base/src/port/portindex.tcl

ryandesign at macports.org ryandesign at macports.org
Sun Nov 9 01:25:39 PST 2008


Revision: 41701
          http://trac.macports.org/changeset/41701
Author:   ryandesign at macports.org
Date:     2008-11-09 01:25:36 -0800 (Sun, 09 Nov 2008)
Log Message:
-----------
portindex.tcl: Generate the port index in a temporary file first, then replace the PortIndex file all at once; fixes #16234

Modified Paths:
--------------
    trunk/base/src/port/portindex.tcl

Modified: trunk/base/src/port/portindex.tcl
===================================================================
--- trunk/base/src/port/portindex.tcl	2008-11-09 08:51:17 UTC (rev 41700)
+++ trunk/base/src/port/portindex.tcl	2008-11-09 09:25:36 UTC (rev 41701)
@@ -136,9 +136,11 @@
 }
 
 puts "Creating software index in $outdir"
-set fd [open [file join $outdir PortIndex] w]
+set tempportindex [mktemp "/tmp/mports.portindex.XXXXXXXX"]
+set fd [open $tempportindex w]
 mporttraverse pindex $directory
 close $fd
+file rename -force $tempportindex [file join $outdir PortIndex]
 puts "\nTotal number of ports parsed:\t$stats(total)\
       \nPorts successfully parsed:\t[expr $stats(total) - $stats(failed)]\t\
       \nPorts failed:\t\t\t$stats(failed)\n"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081109/392f265a/attachment.html>


More information about the macports-changes mailing list