autoconf-patches
[Top][All Lists]
Advanced

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

Re: autotest fails when pwd is testgroup directory


From: Ralf Wildenhues
Subject: Re: autotest fails when pwd is testgroup directory
Date: Thu, 6 Apr 2006 10:52:24 +0200
User-agent: Mutt/1.5.11

Hi Eric,

* Eric Blake wrote on Thu, Apr 06, 2006 at 05:14:06AM CEST:
> > > 
> > > I just noticed that AS_MKDIR_P already does AS_ERROR (fatal to the script)
> > > if it fails,
> > 
> > Which sucks, frankly.  Another badly designed interface that now is less
> > generally usable than it could be.  And we have to stick to it because
> > 2.59 has it, too.  Wish we had chosen a worse name..
> 
> Here's where an interface change might work.  Would this proposal
> be acceptable:
> 
> # AS_MKDIR_P(dir, [allow-fail])

No, I don't like magic args that change some behavior when nonempty.
We may already have a few of them, but they are all ugly, too.

> Or even something like:
> # AS_MKDIR_P(dir, [action-if-fail = AS_ERROR])
> #-----------
> # Ensure that DIR exists, possibly as a symlink, and create
> # it and all intermediate directories if necessary.  On failure,
> # invoke ACTION-IF-FAIL, which defaults to printing an
> # error message and terminating the shell if not specified.

This is better.  But suppose, next year we come up with a situation in
which it would be great to specify that AS_MKDIR_P should be concurrency
safe, or at least optionally so?  What if someone else wanted to be able
to specify the mode bits?  Then you add more arguments, but the order
would be ugly again: the action that happens later is specified in
earlier arguments.  So then you come up with the cool idea that always
the last argument could be the action-if-fail, for >= 2 args, or that
you could try to parse the arguments in m4 and detect what they should
be for; and that is when you have crossed the path over to the dark
side.  :-)

> Either way, it should be easy to change the m4 implementation
> to add the optional $2 argument which would let code avoid
> the AS_ERROR in AS_MKDIR_P.

Yes, but it simply would have been trivial to not let that thing die
by default in the first place.

Anyway, I would favor that we don't do any interface change right now,
but document what we have.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]