[66846] trunk/base/src/macports1.0/macports.tcl

jmr at macports.org jmr at macports.org
Fri Apr 23 12:10:17 PDT 2010


Revision: 66846
          http://trac.macports.org/changeset/66846
Author:   jmr at macports.org
Date:     2010-04-23 12:10:16 -0700 (Fri, 23 Apr 2010)
Log Message:
-----------
update portindex as part of sync (#17157)

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2010-04-23 18:44:45 UTC (rev 66845)
+++ trunk/base/src/macports1.0/macports.tcl	2010-04-23 19:10:16 UTC (rev 66846)
@@ -1811,6 +1811,7 @@
             ui_debug "Skipping $source"
             continue
         }
+        set needs_portindex 0
         ui_info "Synchronizing local ports tree from $source"
         switch -regexp -- [macports::getprotocol $source] {
             {^file$} {
@@ -1840,6 +1841,7 @@
                         continue
                     }
                 }
+                set needs_portindex 1
             }
             {^mports$} {
                 macports::index::sync $macports::portdbpath $source
@@ -1863,6 +1865,7 @@
                 if {[catch {system "chmod -R a+r \"$destdir\""}]} {
                     ui_warn "Setting world read permissions on parts of the ports tree failed, need root?"
                 }
+                set needs_portindex 1
             }
             {^https?$|^ftp$} {
                 if {[_source_is_snapshot $source filename extension]} {
@@ -1919,6 +1922,8 @@
                     }
 
                     file delete $tarpath
+                    
+                    set needs_portindex 1
                 } else {
                     # sync just a PortIndex file
                     set indexfile [macports::getindex $source]
@@ -1931,6 +1936,14 @@
                 ui_warn "Unknown synchronization protocol for $source"
             }
         }
+        
+        if {$needs_portindex} {
+            global macports::prefix
+            set indexdir [file dirname [macports::getindex $source]]
+            if {[catch {system "${macports::prefix}/bin/portindex $indexdir"}]} {
+                ui_error "updating PortIndex for $source failed"
+            }
+        }
     }
 
     # refresh the quick index if necessary (batch or interactive run)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100423/57bb6e83/attachment.html>


More information about the macports-changes mailing list