[MacPorts] #14458: port lint should issue error if port uses deprecated "exit" or "cd" commands

MacPorts trac at macosforge.org
Sat Feb 23 21:57:41 PST 2008


#14458: port lint should issue error if port uses deprecated "exit" or "cd"
commands
--------------------------------------+-------------------------------------
  Reporter:  ryandesign at macports.org  |       Owner:  macports-tickets at lists.macosforge.org
      Type:  enhancement              |      Status:  new                                  
  Priority:  Normal                   |   Milestone:  MacPorts base enhancements           
 Component:  base                     |     Version:  1.6.0                                
Resolution:                           |    Keywords:                                       
--------------------------------------+-------------------------------------
Comment (by ryandesign at macports.org):

 While it's true that someone could do that, in fact I don't think anybody
 does. I'm not trying to catch people who are trying to be tricky; I'm
 trying to catch ports where people simply use the `exit` or `cd` commands
 as normal. `exit` was removed a long time ago, but a new port was just
 committed containing this nonfunctional command. And people are still
 adding new ports using the `cd` command, perhaps because they don't know
 it's going away Real Soon Now.

 If we can't use the Tcl parser somehow to detect this properly, I'd settle
 for the line-by-line parser that we have now. It would have to have flags
 to track whether the line is inside a multiline string or a continuation
 of the line above. And if it's neither (meaning it is a command line and
 it's not a continuation of a previous line) then we would look if the
 first word is "exit" or "cd".

 One special case would be when the command appears on the same line as the
 opening curly brace for the phase; this happens quite a lot, like in the
 perforce port which has a line:

 {{{
 destroot        { cd ${worksrcpath}
 }}}

 But even implementing the feature without support for this special case
 would be an improvement over what we have now.

-- 
Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14458#comment:2>
MacPorts </projects/macports>
Ports system for Mac OS


More information about the macports-tickets mailing list