mirror of
https://github.com/macports/mpbb.git
synced 2026-07-12 18:18:44 -07:00
mpab: better error handling in subports.tcl
git-svn-id: https://svn.macports.org/repository/macports/contrib/mpab@81236 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
+8
-4
@@ -40,17 +40,21 @@ package require macports
|
||||
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user