Re: [patch] acgeneral.m4 (dirname usage)

2000-07-09 Thread Alexandre Oliva
On Jul 9, 2000, "Mark E." <[EMAIL PROTECTED]> wrote: > The below is all true. I can only add the Cygwin uses a leading '//' > specially (as Posix allows) to encode drivenames for their Unix emulation. Not any more (i.e., this is now deprecated). The new recommended Unix-line pathname for c:/

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-09 Thread Chris Faylor
On Sun, Jul 09, 2000 at 08:27:00PM -0400, Mark E. wrote: >[To: line drastically trimmed] > >The below is all true. I can only add the Cygwin uses a leading '//' >specially (as Posix allows) to encode drivenames for their Unix emulation. >For example, 'c:/windows' can and will be encoded as '//c/

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-09 Thread Mark E.
[To: line drastically trimmed] The below is all true. I can only add the Cygwin uses a leading '//' specially (as Posix allows) to encode drivenames for their Unix emulation. For example, 'c:/windows' can and will be encoded as '//c/windows'. So preserving the first double-slash would a good t

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Alexandre Oliva
On Jul 6, 2000, Paul Eggert <[EMAIL PROTECTED]> wrote: > dir al dn eg > .. >1 .. ^ Hey! I had forgotten the `;s,^$,.,' at the end! -

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Alexandre Oliva
On Jul 7, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: >> "Paul" == Paul Eggert <[EMAIL PROTECTED]> writes: Paul> I still think the expr-based solution that I sent to Paul> autoconf-patches yesterday is the way to go. > I agree, I like it. I think we should develop the expr-essionism of

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Paul Eggert
From: Akim Demaille <[EMAIL PROTECTED]> Date: 07 Jul 2000 19:53:35 +0200 There is one question though: how sure are you of the portability of this \| construct? I'm pretty sure it was in Unix Version 7. I've been using it for years. The Hylafax administration scripts use it, and th

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Akim Demaille
> "Paul" == Paul Eggert <[EMAIL PROTECTED]> writes: Paul> I still think the expr-based solution that I sent to Paul> autoconf-patches yesterday is the way to go. I agree, I like it. I think we should develop the expr-essionism of Autoconf, I'm tired to the classical echo | sed paintings :)

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Paul Eggert
From: Bernard Dautrevaux <[EMAIL PROTECTED]> Date: Thu, 6 Jul 2000 17:26:48 +0200 under UN*X, '//1' should give '/', No, under some older flavors of Unix, leading // is a special path name: it refers to a "super-root" and is used to access other machines' files. Leading ///, , etc

RE: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Bernard Dautrevaux
> Subject: Re: [patch] acgeneral.m4 (dirname usage) > > > >>>>> "Bernard" == Bernard Dautrevaux > <[EMAIL PROTECTED]> writes: > > Bernard> If a path starts by a double '/' (that is for any UNC path, > Bernard> quite often found

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Eli Zaretskii
> From: Alexandre Oliva <[EMAIL PROTECTED]> > Date: 06 Jul 2000 12:30:15 -0300 > > What does `dirname' do, on those platforms, when given such special > pathnames? I'm guessing that you are now talking about `dirname' from Bash or from Sh-utils, yes? If so, then it does pretty much the same thi

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-07 Thread Eli Zaretskii
> From: Akim Demaille <[EMAIL PROTECTED]> > Date: 06 Jul 2000 17:03:52 +0200 > > Foreignward compatibility is indeed desired. But are you sure we're > losing here? Mark, or Eli, what do you think we should do? We're > trying to implement dirname. `al' is the current CVS solution. Sorry, I don

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Paul Eggert
From: Akim Demaille <[EMAIL PROTECTED]> Date: 06 Jul 2000 17:03:52 +0200 echo $dir | sed '/^\/*$/!s,//*$,,;s,[^/]*$,,;s,//*$,/,;/^\/$/!s,/$,,' It's not portable to use "echo". On some hosts, "echo" mishandles backslashes and/or names beginning with "-". It's more portable to use "expr",

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: > But are you sure we're losing here? Make that `moving loseward' :-) > Mark, or Eli, what do you think we should do? We're trying to > implement dirname. `al' is the current CVS solution. What does `dirname' do, on those platforms, w

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Bernard Dautrevaux <[EMAIL PROTECTED]> wrote: > If a path starts by a double '/' (that is for any UNC path, quite often > found on DOS boxes), we will strip one of these leading '/' Nope. We'll only do it if we're given `//server00', for example; this will become `/'. For `//s

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Bernard" == Bernard Dautrevaux <[EMAIL PROTECTED]> writes: Bernard> If a path starts by a double '/' (that is for any UNC path, Bernard> quite often found on DOS boxes), we will strip one of these Bernard> leading '/'; thus the directory part of Bernard> "//server00/home/me/myfile" (which

RE: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Bernard Dautrevaux
> -Original Message- > From: Akim Demaille [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 06, 2000 2:05 PM > To: Lars J. Aas > Cc: Alexandre Oliva; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: [patch] acgeneral.m4 (dirname u

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
Akim> undocumentedward-underscoredward compatible. Alexandre> These words are getting Awkimward. Lars> And you are getting awkimward compatible... :) :) Hi'm rooling ze warld!

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Lars J. Aas
On Thu, Jul 06, 2000 at 08:13:03AM -0300, Alexandre Oliva wrote: : On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: : > undocumentedward-underscoredward compatible. : : These words are getting Awkimward. And you are getting awkimward compatible... Lars J

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: > undocumentedward-underscoredward compatible. These words are getting Awkimward. -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD st

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Lars" == Lars J Aas <[EMAIL PROTECTED]> writes: Lars> On Thu, Jul 06, 2000 at 10:06:10AM +0200, Akim Demaille wrote: : Lars> So until we know we have it right for sure, it should not be Lars> public. Lars> So what does that mean? Just undocumented in the .texi file, or Lars> underscoring

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: >> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Alexandre> It works with Solaris' sed, and is significant more Alexandre> complicated because of some lossage in it. > I don't think we need this Indeed, we don't, Solaris

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Alexandre> It works with Solaris' sed, and is significant more Alexandre> complicated because of some lossage in it. I don't think we need this, I never heard of anything like this. And the Solaris system I tried works fine: Last

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Lars J. Aas
On Thu, Jul 06, 2000 at 10:06:10AM +0200, Akim Demaille wrote: : So until we know we have it right for sure, it should not be public. So what does that mean? Just undocumented in the .texi file, or underscoring the macro name? Lars J

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Martin Wilck <[EMAIL PROTECTED]> wrote: > I think "!" after a sed address expression is not portable - > actually, it seems to work only with GNU sed. Thanks. How about this, then: al=`echo $dir | sed 's%^\(..*/[^/][^/]*\)//*$%\1%;s%^\(.[^/]*\)//*$%\1%;s%[^/]*$%%;s%^\(..*/[^/

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Martin Wilck
> Hm, I've used this many times, and have never been trapped. Which sed > are you thinking about? Sorry, I was wrong. Problem was: I had a space between the "!" and the sed command. :( *That* is only supported by GNU sed.

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Martin" == Martin Wilck <[EMAIL PROTECTED]> writes: >> > al=`echo $dir | sed >> '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'` ^^ >> ^^ Martin> Martin> ^ I think "!" after a sed address expression is not portable - Martin> actually, it seems to work only with GNU sed. Hm,

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Martin Wilck
> > al=`echo $dir | sed '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'` > ^^ ^^ ^ I think "!" after a sed address expression is not portable - actually, it

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: > How about using commas instead of %? That's my preference too. I was just keeping the style of the original sed script. -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
How about using commas instead of %? Karl Berry pushed me several times to `,' because it results in something more readable: sed '/^\/*$/!s,//*$,,;s,[^/]*$,,;s,//*$,/,;/^\/$/!s,/$,,' sed '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%' and I tend to agree with him.

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Akim> Almost right :) Alexandre> Almost? Seems right to me. Oh, yeah! I momentarily thought you were named texi2dvi, sorry :) I'm approving and applying your patch.

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: >> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Alexandre> Try this one: >>> al=`echo $dir | sed >>> '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'` > Almost right :) Almost? Seems right to me. -- Alexandre O

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Alexandre> Try this one: >> al=`echo $dir | sed >> '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'` Almost right :) ~/src/ace % cat /tmp/dirname.sh nostromo 10:59 #! /bin/sh format="%12s %1

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Alexandre Oliva
On Jul 6, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote: > Some more work will be needed. Try this one: > al=`echo $dir | sed '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'` ^^ ^^ -- Alexandre Oliva Enjoy Guarana', see

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes: Alexandre> The patch is fine Applied. Alexandre> I'm not 100% sure about its portability, though. There is nothing risky, IMHO, in there. Some more work will be needed. src/ace/patches % cat /tmp/dirname.sh

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-06 Thread Akim Demaille
> "Ralf" == Ralf Corsepius <[EMAIL PROTECTED]> writes: Ralf> With your patch however, I would expect people to start using Ralf> AC_SHELL_DIRNAME instead of dirname and therefore I would expect Ralf> it to hit some time. Personally I'd prefer that you don't make it public, it is too young. M

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Ralf Corsepius
"Lars J. Aas" wrote: > > On Wed, Jul 05, 2000 at 05:12:19PM +0200, Ralf Corsepius wrote: > : "Lars J. Aas" wrote: > : > > : > +# AC_SHELL_DIRNAME(PATHNAME) > : > +# -- > : > +# Remove last slash and trailing text. > : > +# Not all systems have dirname, so we emulate it wit

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Alexandre Oliva
On Jul 5, 2000, "Lars J. Aas" <[EMAIL PROTECTED]> wrote: > +[echo $1 | sed 's%/[[^/][^/]]*$%%']) This is not strictly correct. It doesn't handle relative pathnames nor `/'. The patch is fine, since it just preserves current behavior, and it makes it easier for someone to fix the existing lim

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Lars J. Aas
On Wed, Jul 05, 2000 at 05:12:19PM +0200, Ralf Corsepius wrote: : "Lars J. Aas" wrote: : > : > +# AC_SHELL_DIRNAME(PATHNAME) : > +# -- : > +# Remove last slash and trailing text. : > +# Not all systems have dirname, so we emulate it with sed. : > +# This macro must be usab

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Ralf Corsepius
"Lars J. Aas" wrote: > > +# AC_SHELL_DIRNAME(PATHNAME) > +# -- > +# Remove last slash and trailing text. > +# Not all systems have dirname, so we emulate it with sed. > +# This macro must be usable from inside ` `. > +define([AC_SHELL_DIRNAME], > +[echo $1 | sed 's%/[[^/][

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Lars J. Aas
On Wed, Jul 05, 2000 at 04:10:54PM +0200, Akim Demaille wrote: : Lars> There's obviously one set of ""s too much here. Should the : Lars> redundant pair be removed in the macro definition or the macro : Lars> invocations? : : I'd say from the macro. : : BTW, you should state in the comment of A

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Akim Demaille
> "Bernard" == Bernard Dautrevaux <[EMAIL PROTECTED]> writes: Bernard> I'd rather suppress them from the macro invokations; when Bernard> reusing AC_SHELL_DIRNAME I thus has less to type :-) Right, but I personally want to have full control over this kind of things. And just imagine it was

RE: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Bernard Dautrevaux
> -Original Message- > From: Lars J. Aas [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 05, 2000 3:17 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [patch] acgeneral.m4 (dirname usage) > > > On Wed, Jul 05, 2000 at 03:05:13PM +0200, Lars J

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Akim Demaille
> "Lars" == Lars J Aas <[EMAIL PROTECTED]> writes: Lars> There's obviously one set of ""s too much here. Should the Lars> redundant pair be removed in the macro definition or the macro Lars> invocations? I'd say from the macro. BTW, you should state in the comment of AC_SHELL_DIRNAME that

Re: [patch] acgeneral.m4 (dirname usage)

2000-07-05 Thread Lars J. Aas
On Wed, Jul 05, 2000 at 03:05:13PM +0200, Lars J. Aas wrote: : +define([AC_SHELL_DIRNAME], : +[echo "$1" | sed 's%/[[^/][^/]]*$%%']) [...]^ ^ : + ac_dir=`AC_SHELL_DIRNAME("$ac_file")` [...] ^^ : +ac_dir=`AC_SHELL_DIRNAME("$ac_file")` [...]