From 3a8ea357850a2f25f39a7df6e12b777ee117fd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Mon, 25 Jan 2016 17:41:39 +0100 Subject: [PATCH] Fixes issue https://github.com/racket/racket/issues/1223 ( moved to https://github.com/racket/distro-build/issues/1 ) --- distro-build-client/unix-installer/installer-header | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/distro-build-client/unix-installer/installer-header b/distro-build-client/unix-installer/installer-header index 6cb7fcb..5f6c283 100644 --- a/distro-build-client/unix-installer/installer-header +++ b/distro-build-client/unix-installer/installer-header @@ -92,6 +92,7 @@ done ## Utilities PATH=/usr/bin:/bin +origPATH="$PATH" if test "x`echo -n`" = "x-n"; then echon() { /bin/echo "$*\c"; } @@ -128,6 +129,17 @@ lookfor() { return fi done + for dir in $origPATH; do + if test -x "$dir/$1"; then + echo "Warning: $1 found in a non-standrad place: $dir/$1" + # Reset PATH, as it is likely the command found in a non-standard place + # will not work properly with the basic PATH. + PATH="$origPATH" + eval "$1=$dir/$1" + IFS="$saved_IFS" + return + fi + done IFS="$saved_IFS" failwith "could not find \"$1\"." }