From 73eb0329045966274391ed949421fd91c37a9b82 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 17 May 2010 22:23:52 +0200 Subject: [PATCH] xbps-src: check for required utilities in the host system. --- README | 2 +- xbps-src/xbps-src.sh.in | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README b/README index 18cf91e1e33..1841ad2f691 100644 --- a/README +++ b/README @@ -75,7 +75,7 @@ and its helpers: To build binary packages with xbps-src also the following software needs to be installed into the host system: - - awk, bash, bison, gcc c++, gettext, path, texinfo, perl and fakeroot. + - awk, bash, gcc c++, gettext, patch, texinfo, perl and fakeroot. - xbps static utilities, available from http://launchpad.net/xbps. Additionally if you want to work as 'root': diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 56075b1f9b7..2cc2d0035b7 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -46,6 +46,21 @@ sighandler_exit() exit $? } +check_reqhost_utils() +{ + [ -n "$in_chroot" ] && return 0 + + echo -n "=> Checking for required host utilities... " + for f in awk bash sed gcc msgfmt patch makeinfo perl fakeroot; do + if ! command -v ${f} 2>&1 >/dev/null; then + echo + echo "${f} is missing in your system, can't continue! exiting..." + exit 1 + fi + done + echo "done." +} + usage() { cat << _EOF @@ -178,6 +193,11 @@ if [ -z "$target" ]; then usage && exit 1 fi +# +# Check for required utilities in host system. +# +check_reqhost_utils + # # Check configuration vars before anyting else, and set defaults vars. #