diff options
author | obache <obache@pkgsrc.org> | 2013-10-31 12:18:19 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2013-10-31 12:18:19 +0000 |
commit | 10f8e8d967cb72d3524f600b4619c4fe85811a20 (patch) | |
tree | 62dfcfc96d173520348927cdf15a13ac92cabf99 /devel | |
parent | ce8728c9e74e707320df99809381f31f7fc64fc2 (diff) | |
download | pkgsrc-10f8e8d967cb72d3524f600b4619c4fe85811a20.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-x | devel/bmake/files/boot-strap | 16 | ||||
-rw-r--r-- | devel/bmake/files/unit-tests/modts | 4 |
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 |