tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Improving 'bmake wrapper' speed



On Mon, Sep 01, 2014 at 09:51:42PM +0200, Joerg Sonnenberger wrote:
> On Fri, Aug 22, 2014 at 02:18:42PM +0100, Jonathan Perkin wrote:
> > Tracking these down, the 'cat's are primarily from
> > mk/wrapper/gen-transform.sh, and the ln/rm/dirname are from each
> > symlink done by mk/buildlink3/bsd.buildlink3.mk.
> 
> Changing the cats to echo is fine, but I would prefer to use '' for
> quoting.

The shell variable expansions need to be inside "", the other text could
be inside '', but repeatedly flipping the type of quotes is error prone.
You do need to flip if you want a " though "xx"'"'"yy" gives xx"yy

> The dirname invocations are more tricky, since it could change
> the behavior if a case of trailing slashes ever come through. I would
> prefer to leave that one out.

Or use an extra shell assignment to strip trailing slashes.

If it is doing 'dirname' of a filename (rather than a directory name)
then there shouldn't be any problem.

Or some horrid hackey based on teh properties of IFS and $*.
If you know what the below prints:

(IFS=/; x="abc//def/geh/"; set -- $x; IFS=' '; x="$*"; set -- $x; IFS=/; x="$*"; IFS=' '; echo "$x"; )

	David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index