[coreboot-gerrit] New patch to review for coreboot: buildgcc: Clarify required user action
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Mon Jun 15 21:38:23 CEST 2015
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10555
-gerrit
commit 1e747d0f7a497ad4ca880ca096393d83c8268364
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date: Mon Jun 15 12:36:53 2015 -0700
buildgcc: Clarify required user action
When required tools are missing, try to give the user more detailed
information on how to solve the problem.
Change-Id: Ifa21c1af38a036a7d4f5a786041a87a7d45f4ec5
Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
util/crossgcc/buildgcc | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 7f440f7..1bceccb 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -107,6 +107,18 @@ normalize_dirs()
perl -pi -e "s,/lib64,/lib," $DESTDIR$TARGETDIR/lib/*.la
}
+please_install()
+{
+ test -r /etc/os-release && source /etc/os-release
+ case "$ID_LIKE" in
+ debian) solution="sudo apt-get install $1" ;;
+ suse) solution="sudo zypper install $1" ;;
+ "") solution="using your OS packaging system" ;;
+ esac
+
+ printf "${RED}ERROR:${red} Missing tool: Please install \'$1\' utility. (eg $solution)${NC}\n" >&2
+}
+
searchtool()
{
# $1 short name
@@ -157,7 +169,7 @@ searchtool()
fi
fi
fi
- printf "${RED}ERROR:${red} Missing tool: Please install $1 (eg using your OS packaging system)${NC}\n" >&2
+ please_install $1
[ -z "$3" ] && exit 1
false
}
More information about the coreboot-gerrit
mailing list