On Wed, 2008-12-31 at 14:10 -0500, Jameson Graef Rollins wrote: > On Wed, Dec 31, 2008 at 06:26:43PM +0000, Adam D. Barratt wrote: > > It does, but only if it's one of the forms "source ./foo", > > "source /foo/bar" or "source $foo". I can't see any obvious reason from > > the changelog, that "source bar" isn't flagged, but I'm not currently > > sure whether there was a good reason it's not, or simply an omission. > > Actually, it appears that it doesn't work for anything in quotes > either: > > servo:/tmp/cdtemp.XcoaZB 0$ cat ./foo > #!/bin/sh > source "./bar" > servo:/tmp/cdtemp.XcoaZB 0$ checkbashisms -p ./foo > servo:/tmp/cdtemp.XcoaZB 0$ > > I guess I should have used that, since that was how I discovered it.
It does, but only since 2.10.39 (i.e. a couple of months ago, and a few months after the freeze). > > > I must say I'm a bit surprised this hasn't come up before. Why would > > > that be? Makes me wonder... > > > > Wonder what? Basically, you've found a corner case that's not currently > > covered; it's not entirely missing. > > I didn't realize that those other cases were caught. But also I would > have thought the quoted case would have come up more frequently as > well. I pretty much always use quotes around variables, and I thought > that was a fairly common practice, which would mean something like > this would not be caught: > > source "$DIR"/bar I'm surprised it wasn't caught earlier as well. The timing means that lenny's checkbashisms won't flag the above, but I'm fully expecting a lenny-backports upload very soon after the release of lenny. > But you're right, it is still a bit of a corner case. It is a case we should at least consider supporting, however. I just need to try and remember if there's a good reason we didn't do so in the first place. :) Adam -- To unsubscribe, send mail to [email protected].
