[MacPorts] #14458: port lint should issue error if port uses deprecated "exit" or "cd" commands
#14458: port lint should issue error if port uses deprecated "exit" or "cd" commands -------------------------------------+-------------------------------------- Reporter: ryandesign@macports.org | Owner: macports-tickets@lists.macosforge.org Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts base enhancements Component: base | Version: 1.6.0 Keywords: | -------------------------------------+-------------------------------------- `port lint` should issue an error if a port uses the "`exit`" command which was removed by MacPorts 1.6 or the "`cd`" command which will be removed by MacPorts 1.7. Care should be taken in the implementation because `port lint` should only complain if these commands are being used as tcl commands, but ''not'' if they appear in a (possibly multiline) string or comment. -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14458> MacPorts </projects/macports> Ports system for Mac OS
#14458: port lint should issue error if port uses deprecated "exit" or "cd" commands --------------------------------------+------------------------------------- Reporter: ryandesign@macports.org | Owner: macports-tickets@lists.macosforge.org Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts base enhancements Component: base | Version: 1.6.0 Resolution: | Keywords: --------------------------------------+------------------------------------- Comment (by raimue@macports.org): Not that easy to implement, I think. It would require to check full Tcl syntax. For example: {{{ set cd foo # valid set [cd foo] # invalid cd foo # invalid set exit 1 # valid exit 1 # invalid do; exit 1 # invalid do && exit 1 # invalid }}} But this can also be complexer, as you can create variable functions: {{{ set foo exit $foo 1 # is now equivalent to `exit 1' }}} -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14458#comment:1> MacPorts </projects/macports> Ports system for Mac OS
#14458: port lint should issue error if port uses deprecated "exit" or "cd" commands --------------------------------------+------------------------------------- Reporter: ryandesign@macports.org | Owner: macports-tickets@lists.macosforge.org Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts base enhancements Component: base | Version: 1.6.0 Resolution: | Keywords: --------------------------------------+------------------------------------- Comment (by ryandesign@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
#14458: port lint should issue error if port uses deprecated "exit" or "cd" commands --------------------------------------+------------------------------------- Reporter: ryandesign@macports.org | Owner: macports-tickets@lists.macosforge.org Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts base enhancements Component: base | Version: 1.6.0 Resolution: | Keywords: --------------------------------------+------------------------------------- Comment (by afb@macports.org): Hmm, port lint only does a two-pass static analysis at the moment (once to check the file, like for encoding and location and once to parse the file syntax and read the basic metadata variables) Things like deprecated tcl commands should be evident from the trial build of the port, so I'm not sure whether they need to be checked with lint ? (since that would mean having to parse/run stuff) -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14458#comment:3> MacPorts </projects/macports> Ports system for Mac OS
participants (1)
-
MacPorts