[Bug ada/49511] [4.6 Regression] acats test setup fails on HP-UX using posix shell
dave at hiauly1 dot hia.nrc.ca
gcc-bugzilla@gcc.gnu.org
Tue Jun 28 18:47:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49511
--- Comment #4 from dave at hiauly1 dot hia.nrc.ca 2011-06-28 18:46:19 UTC ---
On Tue, 28 Jun 2011, ro at CeBiTec dot Uni-Bielefeld.DE wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49511
>
> --- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-06-28 17:58:01 UTC ---
> > 505 (hiauly1)dave> /bin/sh
> > $ type -p gnatmake 2>/dev/null
> > gnatmake is /opt/gnu/gcc/gcc-3.3.4/bin/gnatmake
> > $ echo $?
> > 0
>
> Drats, sh silently ignores -p. The following (untested) patch should
> cope with this:
>
> Could you give it a try?
The following revised patch works. There was a missing quote and
the problem also affects HP-UX 11. I just never hit it since I always
build with bash.
Index: ada/acats/run_acats
===================================================================
--- ada/acats/run_acats (revision 175188)
+++ ada/acats/run_acats (working copy)
@@ -10,11 +10,11 @@
# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
# ksh93 and bash have it.
# type output format differs between ksh88 and ksh93, so avoid it if
-# type -p is present.
+# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
which () {
- path=`type -p $* 2>/dev/null` && { echo $path; return 0; }
+ path=`type -p $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return
0; }
path=`type $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return 0;
}
path=`whence $* 2>/dev/null` && { echo $path; return 0; }
return 1
Thanks,
Dave
More information about the Gcc-bugs
mailing list