[81236] contrib/mpab/subports.tcl

jmr at macports.org jmr at macports.org
Wed Jul 27 17:50:09 PDT 2011


Revision: 81236
          http://trac.macports.org/changeset/81236
Author:   jmr at macports.org
Date:     2011-07-27 17:50:08 -0700 (Wed, 27 Jul 2011)
Log Message:
-----------
mpab: better error handling in subports.tcl

Modified Paths:
--------------
    contrib/mpab/subports.tcl

Modified: contrib/mpab/subports.tcl
===================================================================
--- contrib/mpab/subports.tcl	2011-07-28 00:43:15 UTC (rev 81235)
+++ contrib/mpab/subports.tcl	2011-07-28 00:50:08 UTC (rev 81236)
@@ -40,17 +40,21 @@
 
 if {[catch {mportinit "" "" ""} result]} {
    ui_error "$errorInfo"
-   fatal "Failed to initialize ports sytem: $result"
+   ui_error "Failed to initialize ports sytem: $result"
+   exit 1
 }
 
 if {[llength $::argv] == 0} {
-    fatal "Usage: $argv0 <portname>"
+    puts stderr "Usage: $argv0 <portname>"
+    exit 1
 }
 
 set portname [lindex $::argv 0]
 
-if {[catch {set one_result [mportlookup $portname]}]} {
-    fatal "lookup failed for port: $portname"
+if {[catch {set one_result [mportlookup $portname]}] || [llength $one_result] < 2} {
+    # just pass it through, MPAB will complain about it later
+    puts $portname
+    exit 0
 }
 puts [lindex $one_result 0]
 array set portinfo [lindex $one_result 1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110727/cb87573c/attachment.html>


More information about the macports-changes mailing list