From 10f8e8d967cb72d3524f600b4619c4fe85811a20 Mon Sep 17 00:00:00 2001 From: obache Date: Thu, 31 Oct 2013 12:18:19 +0000 Subject: Take care for the case missing `type' command, PR pkg/48089. No objection from MAINTAINER over 3 month. --- devel/bmake/files/boot-strap | 16 ++++++++++++++-- devel/bmake/files/unit-tests/modts | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'devel/bmake') 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 # 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 -- cgit v1.2.3