[35648] trunk/base/src

raimue at macports.org raimue at macports.org
Tue Apr 1 06:48:25 PDT 2008


Revision: 35648
          http://trac.macosforge.org/projects/macports/changeset/35648
Author:   raimue at macports.org
Date:     2008-04-01 06:48:23 -0700 (Tue, 01 Apr 2008)

Log Message:
-----------
port/port.tcl, macports/macports.tcl:
 * Pass optional $optionslist to mportsync
 * Only sync daily snapshot if the tarball is newer than the local ports directory

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

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2008-04-01 13:09:48 UTC (rev 35647)
+++ trunk/base/src/macports1.0/macports.tcl	2008-04-01 13:48:23 UTC (rev 35648)
@@ -1348,11 +1348,12 @@
     mportsync
 }
 
-proc mportsync {} {
+proc mportsync {{optionslist {}}} {
     global macports::sources macports::portdbpath macports::rsync_options tcl_platform
     global macports::portverbose
-    global macports::autoconf::rsync_path 
-    
+    global macports::autoconf::rsync_path
+    array set options $optionslist
+
     set numfailed 0
 
     ui_debug "Synchronizing ports tree(s)"
@@ -1419,6 +1420,19 @@
                     set destdir [file dirname $indexfile]
                     set tarpath [file join [file normalize [file join $destdir ..]] $filename]
 
+                    set updated 1
+                    if {[file isdirectory $destdir]} {
+                        set moddate [file mtime $destdir]
+                        if {[catch {set updated [curl isnewer $source $moddate]} error]} {
+                            ui_warn "Cannot check if $source was updated, ($error)"
+                        }
+                    }
+
+                    if {(![info exists options(ports_force)] || $options(ports_force) != "yes") && $updated <= 0} {
+                        ui_info "No updates for $source"
+                        continue
+                    }
+
                     file mkdir [file dirname $indexfile]
 
                     set verboseflag {}
@@ -1742,7 +1756,7 @@
     
     # syncing ports tree.
     if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} {
-        if {[catch {mportsync} result]} {
+        if {[catch {mportsync $optionslist} result]} {
             return -code error "Couldn't sync the ports tree: $result"
         }
     }

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2008-04-01 13:09:48 UTC (rev 35647)
+++ trunk/base/src/port/port.tcl	2008-04-01 13:48:23 UTC (rev 35648)
@@ -2196,8 +2196,10 @@
 
 
 proc action_sync { action portlist opts } {
+    global global_options
+
     set status 0
-    if {[catch {mportsync} result]} {
+    if {[catch {mportsync [array get global_options]} result]} {
         global errorInfo
         ui_debug "$errorInfo"
         ui_msg "port sync failed: $result"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080401/d109ce68/attachment.html


More information about the macports-changes mailing list