AS_DIRNAME

View: New views
4 Messages — Rating Filter:   Alert me  

AS_DIRNAME

by Peter Johansson-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Under weaknesses for `dirname' the manual (v2.64) mentions that one
should use macro AS_DIRNAME instead. The macro seems to do what I want,
but I cannot find it in the manual? Is it safe to use that macro or
should I consider it as an internal..?

Thanks,
Peter

--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat



_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: AS_DIRNAME

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Peter,

* Peter Johansson wrote on Mon, Sep 28, 2009 at 11:24:51PM CEST:
> Under weaknesses for `dirname' the manual (v2.64) mentions that one
> should use macro AS_DIRNAME instead. The macro seems to do what I
> want, but I cannot find it in the manual? Is it safe to use that
> macro or should I consider it as an internal..?

I think we should document AS_DIRNAME, not doing so was probably an
omission, esp. since it is mentioned a couple of times in the manual.

Thanks,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: AS_DIRNAME

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/29/2009 11:49 PM:

> Hello Peter,
>
> * Peter Johansson wrote on Mon, Sep 28, 2009 at 11:24:51PM CEST:
>> Under weaknesses for `dirname' the manual (v2.64) mentions that one
>> should use macro AS_DIRNAME instead. The macro seems to do what I
>> want, but I cannot find it in the manual? Is it safe to use that
>> macro or should I consider it as an internal..?
>
> I think we should document AS_DIRNAME, not doing so was probably an
> omission, esp. since it is mentioned a couple of times in the manual.

At one point it was documented.  Then later, we pulled the documentation,
since the interface is less than ideal (it doesn't handle trailing
newlines, although those are rare); a better interface would start
searching for shells that support the POSIX feature of ${var%/*}, so we
don't even have to fork to implement this on decent machines.

But yes, I agree that until we implement the better interface, we probably
ought to revive the documentation.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrDPwYACgkQ84KuGfSFAYDnTgCdH6gknXBbn/n9th7/FBkGnrP1
HSUAni6HZtnM1V6jqXsftSV1i+nIKVR8
=QLnK
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf

Re: AS_DIRNAME

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/30/2009 5:20 AM:
> According to Ralf Wildenhues on 9/29/2009 11:49 PM:
>> I think we should document AS_DIRNAME, not doing so was probably an
>> omission, esp. since it is mentioned a couple of times in the manual.
>
> At one point it was documented.  Then later, we pulled the documentation,
> since the interface is less than ideal (it doesn't handle trailing
> newlines, although those are rare); a better interface would start
> searching for shells that support the POSIX feature of ${var%/*}, so we
> don't even have to fork to implement this on decent machines.

Well, I haven't improved the implementation for 2.65; that will have to be
a later release.  But I have restored the documentation (sorry that it
took me a month).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkryPE0ACgkQ84KuGfSFAYD7ygCeMdQmUj2ywdny1bv+zvsqgy6Q
E+EAoLO5kOpaChh5FqivZ5aY9JMnFQ6z
=ldXl
-----END PGP SIGNATURE-----

From 9d6e4a750dff8023e03ee30277bfa9016e9cd523 Mon Sep 17 00:00:00 2001
From: Eric Blake <ebb9@...>
Date: Wed, 4 Nov 2009 19:44:38 -0700
Subject: [PATCH] Redocument AS_DIRNAME, even with its flaws.

* doc/autoconf.texi (Common Shell Constructs) <AS_DIRNAME>:
Restore documenatation, since dirname mentions it.
Reported by Peter Johansson.

Signed-off-by: Eric Blake <ebb9@...>
---
 ChangeLog         |    5 +++++
 doc/autoconf.texi |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e216f92..4d028c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-11-04  Eric Blake  <ebb9@...>

+ Redocument AS_DIRNAME, even with its flaws.
+ * doc/autoconf.texi (Common Shell Constructs) <AS_DIRNAME>:
+ Restore documenatation, since dirname mentions it.
+ Reported by Peter Johansson.
+
  Update upstream files.
  * build-aux/announce-gen: Synchronize from upstream.
  * build-aux/config.guess: Likewise.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 7ca8771..0177831 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -12964,14 +12964,15 @@ Common Shell Constructs
 @end defmac

 @c Deprecated, to be replaced by a better API
-@ignore
 @defmac AS_DIRNAME (@var{file-name})
 @asindex{DIRNAME}
 Output the directory portion of @var{file-name}.  For example,
 if @code{$file} is @samp{/one/two/three}, the command
 @code{dir=`AS_DIRNAME(["$file"])`} sets @code{dir} to @samp{/one/two}.
+
+This interface may be improved in the future to avoid forks and losing
+trailing newlines.
 @end defmac
-@end ignore

 @defmac AS_ECHO (@var{word})
 @asindex{ECHO}
--
1.6.5.rc1


_______________________________________________
Autoconf mailing list
Autoconf@...
http://lists.gnu.org/mailman/listinfo/autoconf