port doesn't exit with proper return value

Bryan Blackburn blb at macports.org
Fri May 16 01:44:09 PDT 2008


In base/src/port/port.tcl (what becomes ${prefix}/bin/port), proc  
process_cmd returns $action_status which eventually becomes  
$exit_status (and hence port's return value).  However, it appears  
this is always reset to 0 because of the part:

         # If we're not in exit mode then ignore the status from the  
command
         if { ![macports::ui_isset ports_exit] } {
             set action_status 0
         }

At the end of port.tcl (line 2869 as of svn right now) is:

     if {![info exists ui_options(ports_commandfiles)]} {
         set ui_options(ports_exit) yes
     }

So ports_exit should be set to yes, but that macports::ui_isset  
doesn't seem to be noticing it.  Are there issues with ui_options and  
macports::ui_isset that's causing this?

Changing the bit in process_cmd to:

         # If we're not in exit mode then ignore the status from the  
command
         if { ![info exists ui_options(ports_exit)] } {
             set action_status 0
         }

makes it work as it should.

Bryan



More information about the macports-dev mailing list