summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorobache <obache>2013-10-31 12:18:19 +0000
committerobache <obache>2013-10-31 12:18:19 +0000
commit586d9e4c6cad5fcac24c3283e9b84971b2c62f2f (patch)
tree62dfcfc96d173520348927cdf15a13ac92cabf99 /devel
parent0de8f18f0432fd8f9732151d5016a0aff5497dd7 (diff)
downloadpkgsrc-586d9e4c6cad5fcac24c3283e9b84971b2c62f2f.tar.gz
Take care for the case missing `type' command, PR pkg/48089.
No objection from MAINTAINER over 3 month.
Diffstat (limited to 'devel')
-rwxr-xr-xdevel/bmake/files/boot-strap16
-rw-r--r--devel/bmake/files/unit-tests/modts4
2 files changed, 16 insertions, 4 deletions
diff --git a/devel/bmake/files/boot-strap b/devel/bmake/files/boot-strap
index e5f60a6b651..83539d5e484 100755
--- a/devel/bmake/files/boot-strap
+++ b/devel/bmake/files/boot-strap
@@ -63,7 +63,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: boot-strap,v 1.10 2011/06/18 22:39:46 bsiegert Exp $
+# $Id: boot-strap,v 1.11 2013/10/31 12:18:19 obache Exp $
#
# @(#) Copyright (c) 2001 Simon J. Gerraty
#
@@ -236,6 +236,18 @@ add_path () {
no_path $* && eval ${2:-PATH}="$__p${__p:+:}$1"
}
+find_prog () {
+ saved_IFS="$IFS"
+ IFS=":"
+ for p in $PATH; do
+ if [ -x "$p/$1" ]; then
+ echo "$p/$1"
+ break;
+ fi
+ done
+ IFS="$saved_IFS";
+}
+
srcdir=`GetDir /bmake "$srcdir" "$2" "$Mydir" ./bmake* "$Mydir"/../bmake*`
[ -d "${srcdir:-/dev/null}" ] || Usage
@@ -310,7 +322,7 @@ if [ -s "${mksrc:-/dev/null}/install-mk" ]; then
esac
fi
# make sure test below uses the same diff that configure did
-TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'`
+TOOL_DIFF=`find_prog diff`
export MAKESYSPATH TOOL_DIFF
if [ "$mksrc" ]; then
$objdir/bmake test || exit 1
diff --git a/devel/bmake/files/unit-tests/modts b/devel/bmake/files/unit-tests/modts
index 616bd8944f2..54b3d3d2ffa 100644
--- a/devel/bmake/files/unit-tests/modts
+++ b/devel/bmake/files/unit-tests/modts
@@ -12,9 +12,9 @@ all: mod-ts
# Use print or printf iff they are builtin.
# XXX note that this causes problems, when make decides
# there is no need to use a shell, so avoid where possible.
-.if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != ""
+.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
PRINT= print -r --
-.elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != ""
+.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
PRINT= printf '%s\n'
.else
PRINT= echo