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@coreboot.org>
Reviewed-on: http://review.coreboot.org/10555
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Stefan Reinauer 2015-06-15 12:36:53 -07:00
parent db6dd817a2
commit 93a9630be3
1 changed files with 13 additions and 1 deletions

View File

@ -107,6 +107,18 @@ normalize_dirs()
perl -pi -e "s,/lib64,/lib," $DESTDIR$TARGETDIR/lib/*.la 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() searchtool()
{ {
# $1 short name # $1 short name
@ -157,7 +169,7 @@ searchtool()
fi fi
fi 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 [ -z "$3" ] && exit 1
false false
} }