On 07/29/2010 05:15 AM, Stefano Lattarini wrote: > Hello autoconfers. > > There is any reason why the AS_BASENAME and AS_DIRNAME macros don't > have associated as_fn_* shells functions, like e.g. AS_MKDIR_P or > AS_UNSET do? If there is no such reason, you might find the attached > patch useful.
The biggest reason is that I'd _really_ like to implement conditional
support for XSI usage, so that on decent shells, we can perform
dirname/basename without forking via ${a%/*} style manipulations, and
where we no longer chop trailing newlines. But to do that, we need a
new interface:
AS_BASENAME_VAR([varname], [name-to-chop])
We tried deprecating AS_BASENAME in the past (and at one point, it was
even undocumented; we had to reinstate the documentation because people
use it) because it does not lend itself well to the faster implementation.
And once you have the support for XSI detection and a working
AS_BASENAME_VAR function, we would then rewrite AS_BASENAME to something
like:
m4_define([AS_BASENAME],
[AS_BASENAME_VAR([as_name], [$1]); AS_ECHO([$as_name])])
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
