[68414] branches/release_1_9/base/src/port/portindex.tcl

jmr at macports.org jmr at macports.org
Wed Jun 2 20:32:35 PDT 2010


Revision: 68414
          http://trac.macports.org/changeset/68414
Author:   jmr at macports.org
Date:     2010-06-02 20:32:33 -0700 (Wed, 02 Jun 2010)
Log Message:
-----------
merge r68413 from trunk:
 set mtime of PortIndex to that of the newest Portfile parsed, to avoid the possibility of missing changes to unsynced existing ports

Revision Links:
--------------
    http://trac.macports.org/changeset/68413

Modified Paths:
--------------
    branches/release_1_9/base/src/port/portindex.tcl

Modified: branches/release_1_9/base/src/port/portindex.tcl
===================================================================
--- branches/release_1_9/base/src/port/portindex.tcl	2010-06-03 03:26:35 UTC (rev 68413)
+++ branches/release_1_9/base/src/port/portindex.tcl	2010-06-03 03:32:33 UTC (rev 68414)
@@ -38,14 +38,14 @@
 }
 
 proc pindex {portdir} {
-    global target oldfd oldmtime qindex fd directory archive outdir stats full_reindex \
+    global target oldfd oldmtime newest qindex fd directory archive outdir stats full_reindex \
            ui_options port_options save_prefix keepkeys
 
     # try to reuse the existing entry if it's still valid
     if {$full_reindex != "1" && $archive != "1" && [info exists qindex([string tolower [file tail $portdir]])]} {
         try {
             set mtime [file mtime [file join $directory $portdir Portfile]]
-            if {$oldmtime > $mtime} {
+            if {$oldmtime >= $mtime} {
                 set offset $qindex([string tolower [file tail $portdir]])
                 seek $oldfd $offset
                 gets $oldfd line
@@ -109,6 +109,10 @@
         set len [expr [string length $output] + 1]
         puts $fd [list $portinfo(name) $len]
         puts $fd $output
+        set mtime [file mtime [file join $directory $portdir Portfile]]
+        if {$mtime > $newest} {
+            set newest $mtime
+        }
     }
 }
 
@@ -188,6 +192,7 @@
 # open old index for comparison
 if {[file isfile $outpath] && [file isfile ${outpath}.quick]} {
     set oldmtime [file mtime $outpath]
+    set newest $oldmtime
     if {![catch {set oldfd [open $outpath r]}] && ![catch {set quickfd [open ${outpath}.quick r]}]} {
         if {![catch {set quicklist [read $quickfd]}]} {
             foreach entry [split $quicklist "\n"] {
@@ -196,6 +201,8 @@
         }
         close $quickfd
     }
+} else {
+    set newest 0
 }
 
 set tempportindex [mktemp "/tmp/mports.portindex.XXXXXXXX"]
@@ -213,6 +220,7 @@
 }
 close $fd
 file rename -force $tempportindex $outpath
+file mtime $outpath $newest
 mports_generate_quickindex $outpath
 puts "\nTotal number of ports parsed:\t$stats(total)\
       \nPorts successfully parsed:\t[expr $stats(total) - $stats(failed)]\
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100602/4892eecd/attachment.html>


More information about the macports-changes mailing list