[24684] trunk/base/src/port1.0/portsubmit.tcl

source_changes at macosforge.org source_changes at macosforge.org
Sun Apr 29 20:58:21 PDT 2007


Revision: 24684
          http://trac.macosforge.org/projects/macports/changeset/24684
Author:   jberry at macports.org
Date:     2007-04-29 20:58:21 -0700 (Sun, 29 Apr 2007)

Log Message:
-----------
Some port submit cleanup:
 * Revise parsing of output from mpwa and display URL returned for the submitted portpkg

Modified Paths:
--------------
    trunk/base/src/port1.0/portsubmit.tcl

Modified: trunk/base/src/port1.0/portsubmit.tcl
===================================================================
--- trunk/base/src/port1.0/portsubmit.tcl	2007-04-30 03:54:48 UTC (rev 24683)
+++ trunk/base/src/port1.0/portsubmit.tcl	2007-04-30 03:58:21 UTC (rev 24684)
@@ -170,7 +170,7 @@
 
 
 proc submit_main {args} {
-    global mp_remote_submit_url portname portversion prefix UI_PREFIX workpath portpath
+    global mp_remote_submit_url portname portversion portverbose prefix UI_PREFIX workpath portpath
     
     set submiturl $mp_remote_submit_url
   
@@ -182,7 +182,7 @@
    	
    	# Submit to the submit url
     set args "curl"
-    lappend args "--silent "
+    lappend args "--silent"
     lappend args "--url ${submiturl}"
     lappend args "--output ${workpath}/.portsubmit.out"
     lappend args "-F machine=true"
@@ -190,16 +190,41 @@
     #lappend args "-F signeddigest=${digest}"
     set cmd [join $args]
 
-    ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
+    if {[tbool portverbose]} {
+    	ui_msg "Submitting portpkg $pkgpath for $portname to $submiturl"
+    }
 
     ui_debug $cmd
     if {[system $cmd] != ""} {
-		return -code error [format [msgcat::mc "Failed to submit port : %s"] $portname]
+		return -code error [format [msgcat::mc "Failure during submit of port %s"] $portname]
     }
 
-    ui_msg "Submission complete."
+	# Parse the result
+	set fd [open ${workpath}/.portsubmit.out r]
+	array set result [list]
+	while {[gets $fd line] != -1} {
+		regexp -- {^([^:]+):\s*(.*)$} $line unused key value
+		set result($key) $value
+	}
+	close $fd
+	
+	# Interpret and act on the result
+	if {[info exists result(MESSAGE)] && [tbool portverbose]} {
+		ui_msg $result(MESSAGE)
+	}
+	if {[info exists result(STATUS)]} {
+		if { $result(STATUS) == 0 } {
+			if {[info exists result(URL)]} {
+				ui_msg "Submitted $portname port is available at\n ==> $result(URL)"
+			}
+			
+		} else {
+			return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $portname]
+		}
+	} else {
+		return -code error [format [msgcat::mc "Status not received during submit of port %s"] $portname]
+	}
 
-   	# 
     return
     
     # REMNANTS OF KEVIN'S CODE

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


More information about the macports-changes mailing list