[37232] trunk/base/src/port/port.tcl

raimue at macports.org raimue at macports.org
Sat May 31 10:33:01 PDT 2008


Revision: 37232
          http://trac.macosforge.org/projects/macports/changeset/37232
Author:   raimue at macports.org
Date:     2008-05-31 10:33:00 -0700 (Sat, 31 May 2008)

Log Message:
-----------
port/port.tcl:
Check if an action is valid before parsing its arguments

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2008-05-31 17:28:34 UTC (rev 37231)
+++ trunk/base/src/port/port.tcl	2008-05-31 17:33:00 UTC (rev 37232)
@@ -2596,6 +2596,14 @@
         # Reset global_options from base before each action, as we munge it just below...
         array set global_options $global_options_base
         
+        # Find an action to execute
+        set action_proc [find_action_proc $action]
+        if { $action_proc == "" } {
+            puts "Unrecognized action \"$action\""
+            set action_status 1
+            break
+        }
+
         # Parse options that will be unique to this action
         # (to avoid abiguity with -variants and a default port, either -- must be
         # used to terminate option processing, or the pseudo-port current must be specified).
@@ -2626,14 +2634,8 @@
             }
         }
         
-        # Find an action to execute
-        set action_proc [find_action_proc $action]
-        if { $action_proc != "" } {
-            set action_status [$action_proc $action $portlist [array get global_options]]
-        } else {
-            puts "Unrecognized action \"$action\""
-            set action_status 1
-        }
+        # execute the action
+        set action_status [$action_proc $action $portlist [array get global_options]]
 
         # semaphore to exit
         if {$action_status == -999} break

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080531/a668cf0a/attachment.htm 


More information about the macports-changes mailing list