tech-pkg archive

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

Re: make variable expansion oddity

Am 27.05.2016 um 21:35 schrieb Edgar Fuß:
> Is there a variant of the SUBST framework that converts to foo instead 
> of working on foo?

No, there isn't. Currently, you would have to emulate in your own code
what does.

Given that it were implemented, how would you like to use this feature,
using the following example?

SUBST_CLASSES+=    in    pre-configure    *.in     PREFIX docdir

I could think of these possibilities:

1. s,.in$$,,

This would cover all situations that can be expresses with sed(1)
regular expressions. Expressing the renaming in this way has prior art
in pax(1), where it is used to rename or exclude files.

2. $${}

This would expose the implementation detail of the shell variable $file,
but may be more familiar to write. It is more restricted that the
regular expression, since multiple transformations cannot be chained.

3. ${MV} "$$file" "$${}"

Probably too much line noise, and it assumes that the original file is
overwritten at the point the ${MV} is executed.


Home | Main Index | Thread Index | Old Index