public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite, ada] Cope with HP-UX sh in run_acats (PR ada/49511)
@ 2011-06-29 10:14 Rainer Orth
  2011-06-29 18:32 ` Arnaud Charlet
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2011-06-29 10:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arnaud Charlet, John David Anglin

As described in the PR, HP-UX /bin/sh type -p ignores the -p, so we need
to extract the last field of the output just as for regular type.  The
following patch does this, tested by Dave and bootstrapped on
sparc-sun-solaris2.11.

Ok for mainline, 4.6 and 4.5 branches?

Thanks.
        Rainer


2011-06-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR ada/49511
	* ada/acats/run_acats (which): Use last field of type -p output.

diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats
--- a/gcc/testsuite/ada/acats/run_acats
+++ b/gcc/testsuite/ada/acats/run_acats
@@ -10,11 +10,11 @@ fi
 # 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


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [testsuite, ada] Cope with HP-UX sh in run_acats (PR ada/49511)
  2011-06-29 10:14 [testsuite, ada] Cope with HP-UX sh in run_acats (PR ada/49511) Rainer Orth
@ 2011-06-29 18:32 ` Arnaud Charlet
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud Charlet @ 2011-06-29 18:32 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, John David Anglin

> As described in the PR, HP-UX /bin/sh type -p ignores the -p, so we need
> to extract the last field of the output just as for regular type.  The
> following patch does this, tested by Dave and bootstrapped on
> sparc-sun-solaris2.11.
> 
> Ok for mainline, 4.6 and 4.5 branches?

OK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-29 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 10:14 [testsuite, ada] Cope with HP-UX sh in run_acats (PR ada/49511) Rainer Orth
2011-06-29 18:32 ` Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).