Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

Re: [svn] GnuPG - r4817 - trunk

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


wk at gnupg

Aug 27, 2008, 6:55 AM

Post #1 of 3 (119 views)
Permalink
Re: [svn] GnuPG - r4817 - trunk

On Wed, 27 Aug 2008 07:58, cvs[at]cvs.gnupg.org said:

> * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't
> understand '-n'. Use tr to trim the carriage return instead.

David, it seems that you are using Darwin as the development platform.
Although GnuPG should be buildable on any POSIX alike system, I doubt
that we should start to fix all the small glitches that Apple introduced
in their OS again. In particular not the maintainer versions; running
autoconf is maintainer task and not needed on supported platforms.

In this particular case we may better replace echo(1) by printf(1) as
suggested by POSIX to overcome the problems with echo(1). Does Darwin
feature a printf(1) as required by POSIX 2001?

The

m4_esyscmd([.echo $( (svn info 2>/dev/null || echo 'Revision: 0') \
| sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)| tr -d '\n'])

could thus be replaced by

m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
| sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)])

Note that we do not need the "echo 'Revision: 0'" anymore because a

printf "%d"

implicily adds a 0 to its argument list.


What do you think?

Werner


--
Linux-Kongress 2008 + Hamburg + October 7-10 + www.linux-kongress.org

Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel[at]gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


cswiger at mac

Aug 27, 2008, 9:26 AM

Post #2 of 3 (106 views)
Permalink
Re: [svn] GnuPG - r4817 - trunk [In reply to]

Howdy--

On Aug 27, 2008, at 6:55 AM, Werner Koch wrote:
> On Wed, 27 Aug 2008 07:58, cvs[at]cvs.gnupg.org said:
>> * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't
>> understand '-n'. Use tr to trim the carriage return instead.
>
> David, it seems that you are using Darwin as the development platform.
> Although GnuPG should be buildable on any POSIX alike system, I doubt
> that we should start to fix all the small glitches that Apple
> introduced
> in their OS again.

Glitches in Bash? After all, Darwin is using Bash as /bin/sh;
specifically 2.05b.0(1)-release for Darwin 8 (corresponding with OS X
10.4) or 3.2.17(1)-release for Darwin 9 aka 10.5...

> In this particular case we may better replace echo(1) by printf(1) as
> suggested by POSIX to overcome the problems with echo(1). Does Darwin
> feature a printf(1) as required by POSIX 2001?

Yes, in /usr/bin and/or as a shell builtin.

Regards,
--
-Chuck


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel[at]gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


dshaw at jabberwocky

Aug 27, 2008, 11:03 AM

Post #3 of 3 (108 views)
Permalink
Re: [svn] GnuPG - r4817 - trunk [In reply to]

On Wed, Aug 27, 2008 at 09:26:47AM -0700, Chuck Swiger wrote:
> Howdy--
>
> On Aug 27, 2008, at 6:55 AM, Werner Koch wrote:
>> On Wed, 27 Aug 2008 07:58, cvs[at]cvs.gnupg.org said:
>>> * configure.ac: Darwin's /bin/sh has a builtin echo that doesn't
>>> understand '-n'. Use tr to trim the carriage return instead.
>>
>> David, it seems that you are using Darwin as the development platform.
>> Although GnuPG should be buildable on any POSIX alike system, I doubt
>> that we should start to fix all the small glitches that Apple
>> introduced
>> in their OS again.
>
> Glitches in Bash? After all, Darwin is using Bash as /bin/sh;
> specifically 2.05b.0(1)-release for Darwin 8 (corresponding with OS X
> 10.4) or 3.2.17(1)-release for Darwin 9 aka 10.5...

It's not a glich. POSIX doesn't require echo to support -n. It's
very commonly supported, but not required. Darwin (well, OSX) is
POSIX compliant, and chooses to not support -n.

The gotcha is that configure (from autoconf) runs via /bin/sh, and
thus:

cat > echotest.sh
echo -n foo
echo bar
^D

$ sh echotest.sh
-n foo
bar

$ bash echotest.sh
foobar

Optional, but legal behavior.

David

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel[at]gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.