pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/bmake/files Take care for the case missing `type...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/addeffe89239
branches:  trunk
changeset: 626076:addeffe89239
user:      obache <obache%pkgsrc.org@localhost>
date:      Thu Oct 31 12:18:19 2013 +0000

description:
Take care for the case missing `type' command, PR pkg/48089.

No objection from MAINTAINER over 3 month.

diffstat:

 devel/bmake/files/boot-strap       |  16 ++++++++++++++--
 devel/bmake/files/unit-tests/modts |   4 ++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 007d73d42a7c -r addeffe89239 devel/bmake/files/boot-strap
--- a/devel/bmake/files/boot-strap      Thu Oct 31 09:05:32 2013 +0000
+++ b/devel/bmake/files/boot-strap      Thu Oct 31 12:18:19 2013 +0000
@@ -63,7 +63,7 @@
 #      Simon J. Gerraty <sjg%crufty.net@localhost>
 
 # 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 @@
        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 @@
         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 -r 007d73d42a7c -r addeffe89239 devel/bmake/files/unit-tests/modts
--- a/devel/bmake/files/unit-tests/modts        Thu Oct 31 09:05:32 2013 +0000
+++ b/devel/bmake/files/unit-tests/modts        Thu Oct 31 12:18:19 2013 +0000
@@ -12,9 +12,9 @@
 # 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



Home | Main Index | Thread Index | Old Index