From 72d1089fac4d68207c8360ab7b4663b41b16c44e Mon Sep 17 00:00:00 2001 From: Alex Thiessen Date: Fri, 12 Jan 2018 01:45:53 +0000 Subject: util/crossgcc: Output apt-get commands on debian In the buildgcc script, there is a check that the tools required are installed. When a tool is missing, a message is output suggesting an installation method, e.g. `sudo apt-get install foo` on debian-based systems. When run on a true, vanilla debian system, the error message provides only a generic hint because the `please_install()` function fails to detect the OS kind. Detection is based on definition of `ID_LIKE` in `/etc/os-release` yet such systems only define `ID` to `debian`. This commit closes the detection gap. Tested on debian 9 (stretch). Change-Id: I3c867837e9157bee13010bd0a005028c369ce55f Signed-off-by: Alex Thiessen Reviewed-on: https://review.coreboot.org/23231 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- util/crossgcc/buildgcc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util/crossgcc') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 76ed1be9bf..2ee102beb1 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -184,6 +184,10 @@ please_install() { HALT_FOR_TOOLS=1 test -r /etc/os-release && . /etc/os-release + # vanilla debian doesn't define `ID_LIKE`, just `ID` + if [ -z "${ID_LIKE}" ] && [ -n "${ID}" ]; then + ID_LIKE=${ID} + fi case "$ID_LIKE" in debian) solution="sudo apt-get install $1" ;; suse) solution="sudo zypper install $1" ;; -- cgit v1.2.3