bugfindutils - Bugs: bug #11005, import-gnulib.sh use of 'test -e...

 
 

bug #11005: import-gnulib.sh use of 'test -e "$1"/gnulib-tool' is not portable

Submitter:  Mark D Baushke <mbaushke>
Submitted:  Mon 15 Nov 2004 08:12:45 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.2.4 Fixed Release:  4.2.5
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 15 Nov 2004 05:25:45 PM UTC, comment #2: 

It may be worth pointing out that the autoconf manual talks
about the limitations of shell builtins and mentions the
'test -e' problem for Solaris explicitly here:

http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_chapter/autoconf_10.html#SEC122
says

| test (files)
|
|     To enable configure scripts to support
| cross-compilation, they shouldn't do anything that
| tests features of the build system instead of the
| host system. But occasionally you may find it
| necessary to check whether some arbitrary file
| exists. To do so, use `test -f' or `test -r'. Do
| not use `test -x', because 4.3BSD does not have
| it. Do not use `test -e' either, because Solaris
| 2.5 does not have it.

so, even though 'test -e' is something that a
POSIX-compliant shell should handle, it is not
being handled properly by Solaris at the present
time.

Thank you for choosing to work around the POSIX
incompatibility of Solaris

Mark D Baushke <mbaushke>
Mon 15 Nov 2004 09:55:57 AM UTC, comment #1: 

As for the automake problem, this is already logged as
bug #10972.

As far as "test -e" goes, perhaps I should put a note in somewhere that you should be using a POSIX-compliant shell.   POSIX (IEEE Std 1003.1, 2003) requires that "test -e" be supported.  See for example http://www.opengroup.org/onlinepubs/009695399/utilities/test.html

However, the change you suggest is obviously simple and the right thing to do, so I'll just fix that in CVS (plus the bug where we exit import-gnulib with return value 0 without having done anything).

James Youngman <jay>
Group administrator
Mon 15 Nov 2004 08:12:45 AM UTC, original submission:  

'test' is typically built-in to the shell and many shells
do NOT consider 'test -e' to be recognized.

Example: Solaris 9

/bin/sh
$ test -e /tmp/mdbwork/gnulib/gnulib-tool
test: argument expected
bash-2.05$ test -e /tmp/mdbwork/gnulib/gnulib-tool
bash-2.05$ echo $?
0
bash-2.05$

I recommend you replace the 'test -e' with a 'test -f'
in this case.

Even after making this change, there are still a few
problems with following the README-CVS rules in the
cvs version of findutils...

aclocal -I m4 -I gnulib/m4
/usr/local/bin/m4: LIBOBJS_NORMALIZE: No such file or directory
configure.in:138: warning: jm_AC_TYPE_LONG_LONG is m4_require'd but is not m4_defun'd
configure.in:138: jm_AC_TYPE_LONG_LONG is required by...
configure.in:136: jy_AC_TYPE_INTMAX_T is expanded from...
configure.in:138: the top level
bash-2.05$ autoheader
configure.in:138: warning: jm_AC_TYPE_LONG_LONG is m4_require'd but is not m4_defun'd
configure.in:138: jm_AC_TYPE_LONG_LONG is required by...
configure.in:136: jy_AC_TYPE_INTMAX_T is expanded from...
configure.in:138: the top level
bash-2.05$ autoconf
configure.in:138: warning: jm_AC_TYPE_LONG_LONG is m4_require'd but is not m4_defun'd
configure.in:138: jm_AC_TYPE_LONG_LONG is required by...
configure.in:136: jy_AC_TYPE_INTMAX_T is expanded from...
configure.in:138: the top level
configure.in:125: error: possibly undefined macro: jm_AC_TYPE_LONG_LONG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
bash-2.05$
bash-2.05$ automake --add-missing --copy
configure.in:138: warning: jm_AC_TYPE_LONG_LONG is m4_require'd but is not m4_defun'd
configure.in:138: jm_AC_TYPE_LONG_LONG is required by...
configure.in:136: jy_AC_TYPE_INTMAX_T is expanded from...
configure.in:138: the top level
doc/Makefile.am:1: installing `doc/mdate-sh'
configure.in:4: installing `./config.guess'
configure.in:4: installing `./config.sub'
bash-2.05$
bash-2.05$ automake --version
automake (GNU automake) 1.9.3
Written by Tom Tromey <tromey@redhat.com>.

Copyright 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-2.05$ autoconf --version
autoconf (GNU Autoconf) 2.59
Written by David J. MacKenzie and Akim Demaille.

Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-2.05$ aclocal --version
aclocal (GNU automake) 1.9.3
Written by Tom Tromey <tromey@redhat.com>

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-2.05$

Mark D Baushke <mbaushke>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-11-19 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.5
2004-11-15 jay StatusNone Fixed
    Fixed Release4.2.0 None
2004-11-15 jay Dependencies- bugs # is dependent
2004-11-15 jay Assigned toNone jay
    ReleaseNone 4.2.4

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code