public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Philippe De Muyter" <phdm@mail.macqel.be>
To: ian@cygnus.com (Ian Lance Taylor)
Cc: egcs@cygnus.com (egcs mailing list)
Subject: Re: dejagnu runtest and runtest.exp
Date: Mon, 13 Oct 1997 15:02:00 -0000	[thread overview]
Message-ID: <199710132059.WAA11827@mail.macqel.be> (raw)
In-Reply-To: <199710131816.OAA06348@subrogation.cygnus.com>

> Philippe De Muyter just posted a patch
> (< 199710131730.TAA11370@mail.macqel.be >) which should fix that, but I
> think his patch should be changed to search PATH rather than to rely
> on the builtin ``type'' command.

OK, here it is.  With an example it is much easier :)
Note that I use test -x, not -f as in example Ian provided.  This should
perhaps be fixed in configure.

Mon Oct 13 19:15:41 1997  Philippe De Muyter  <phdm@macqel.be>

	* runtest (mypath): Scan $PATH to set mypath if $0 does not give it.

--- ./dejagnu/runtest	Mon Oct 13 22:45:59 1997
+++ ./dejagnu/runtest	Mon Oct 13 22:44:12 1997
@@ -7,13 +7,30 @@
 #
 # Get the execution path to this script and the current directory.
 #
-execpath=`echo ${0-.} | sed  -e 's@/[^/]*$@@'`
+mypath=${0-.}
+if expr ${mypath} : '.*/.*' > /dev/null
+then
+    :
+else
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH
+    do
+	test -z "$dir" && dir=.
+	if test -x $dir/$mypath
+	then
+	    mypath=$dir/$mypath
+	    break
+	fi
+    done
+    IFS="$save_ifs"
+fi
+execpath=`echo ${mypath} | sed  -e 's@/[^/]*$@@'`
 # rootme=`pwd`
 
 #
 # get the name by which runtest was invoked and extract the config triplet
 #
-runtest=`echo ${0-.} | sed -e 's@^.*/@@'`
+runtest=`echo ${mypath} | sed -e 's@^.*/@@'`
 target=`echo $runtest | sed -e 's/-runtest$//'`
 if [ "$target" != runtest ] ; then
     target="--target ${target}"

  reply	other threads:[~1997-10-13 15:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-10  8:51 Philippe De Muyter
1997-10-10  9:08 ` Ian Lance Taylor
1997-10-11 10:12   ` Manfred Hollstein
1997-10-13 11:05     ` Jeffrey A Law
1997-10-13 13:41       ` Ian Lance Taylor
1997-10-13 15:02         ` Philippe De Muyter [this message]
1997-10-15 20:14           ` Jeffrey A Law
1997-10-15 20:16         ` Jeffrey A Law
1997-10-18  0:28           ` Manfred Hollstein
1997-10-18  5:56             ` Philippe De Muyter
1997-10-18 11:38               ` Manfred Hollstein
1997-10-19 18:00                 ` Jeffrey A Law
1997-10-19 19:40                 ` Philippe De Muyter
1997-10-13 15:02   ` Philippe De Muyter
1997-10-13 18:42 meissner
1997-10-15 20:16 ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199710132059.WAA11827@mail.macqel.be \
    --to=phdm@mail.macqel.be \
    --cc=egcs@cygnus.com \
    --cc=ian@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).