[62025] trunk/base/src

jmr at macports.org jmr at macports.org
Sun Dec 27 22:07:40 PST 2009


Revision: 62025
          http://trac.macports.org/changeset/62025
Author:   jmr at macports.org
Date:     2009-12-27 22:07:36 -0800 (Sun, 27 Dec 2009)
Log Message:
-----------
exit from batch/interactive mode after base code is changed by selfupdate

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	2009-12-28 04:54:31 UTC (rev 62024)
+++ trunk/base/src/macports1.0/macports.tcl	2009-12-28 06:07:36 UTC (rev 62025)
@@ -2416,10 +2416,16 @@
 }
 
 # selfupdate procedure
-proc macports::selfupdate {{optionslist {}}} {
+proc macports::selfupdate {{optionslist {}} {updatestatusvar ""}} {
     global macports::prefix macports::portdbpath macports::libpath macports::rsync_server macports::rsync_dir macports::rsync_options
     global macports::autoconf::macports_version macports::autoconf::rsync_path tcl_platform
     array set options $optionslist
+    
+    # variable that indicates whether we actually updated base
+    if {$updatestatusvar != ""} {
+        upvar $updatestatusvar updatestatus
+        set updatestatus no
+    }
 
     # syncing ports tree.
     if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} {
@@ -2507,6 +2513,9 @@
             if { [catch { system "cd $mp_source_path && ./configure $configure_args && make && make install" } result] } {
                 return -code error "Error installing new MacPorts base: $result"
             }
+            if {[info exists updatestatus]} {
+                set updatestatus yes
+            }
         }
     } elseif {$comp < 0} {
         ui_msg "--->  MacPorts base is probably trunk or a release candidate"

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2009-12-28 04:54:31 UTC (rev 62024)
+++ trunk/base/src/port/port.tcl	2009-12-28 06:07:36 UTC (rev 62025)
@@ -2100,13 +2100,18 @@
 
 proc action_selfupdate { action portlist opts } {
     global global_options
-    if { [catch {macports::selfupdate [array get global_options]} result ] } {
+    if { [catch {macports::selfupdate [array get global_options] base_updated} result ] } {
         global errorInfo
         ui_debug "$errorInfo"
         fatal "port selfupdate failed: $result"
     }
     
-    return 0
+    if {$base_updated} {
+        # exit immediately if in batch/interactive mode
+        return -999
+    } else {
+        return 0
+    }
 }
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091227/21f21b4d/attachment.html>


More information about the macports-changes mailing list