From c8665916987e980d3b49b16e99365557068fa64f Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 11 Jun 2015 21:04:31 +0200 Subject: buildgcc: improve portability of 'type' use The precise phrase returned by 'type' differs between locales and shells. It also doesn't matter because it returns an error code when it hasn't found a match. Let's simply assume there's no build_$OneOfOurPackages commands around that could also match. Change-Id: I44f021243149701e8da9dd74c368ca2ad4509419 Signed-off-by: Patrick Georgi Tested-on: linux bash, linux dash, solaris sh, solaris ksh. Reviewed-on: http://review.coreboot.org/10517 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/crossgcc/buildgcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 0979074985..7f440f7366 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -235,7 +235,7 @@ unpack_and_patch() { fn_exists() { - type $1 2>/dev/null | grep -q 'is a function' + type $1 >/dev/null 2>&1 } is_package_enabled() -- cgit v1.2.3