From 010bdb776fa495a1fdd317ea43e622847fe712d7 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 21 Aug 2013 13:39:13 +0200 Subject: [mltk] Script: New Function 'check-devtools', check for devtools now later in running to not impede script help (when invoked witout or wrong parameters). --- mltk | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'mltk') diff --git a/mltk b/mltk index 24de8d33..73de3601 100755 --- a/mltk +++ b/mltk @@ -20,13 +20,6 @@ SELF="$(readlink -f $0)" ROOT_DIR="$(dirname "${SELF}")" MLTK_PID="$$" -# Checking for needed development tools, compilers etc. -# Required: m4 make gcc g++ binutils -DEVTOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs" # 'strip' as marker for binutils -for i in $DEVTOOLS; do - which "$i" 2>/dev/null 1>&2 || { echo "Essential development tool $i not found - exiting."; exit 1; } -done - # Make apt-get install non-interactive when it comes to postinstall questions # ie. kdm asking which dm you want to set as default export DEBIAN_FRONTEND=noninteractive @@ -94,6 +87,16 @@ print_usage() { echo -e "" } + +check_devtools() { + # Checking for needed development tools, compilers etc. + # Required: m4 make gcc g++ binutils + DEVTOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs" # 'strip' as marker for binutils + for i in $DEVTOOLS; do + which "$i" 2>/dev/null 1>&2 || { echo "Essential development tool $i not found - exiting."; exit 1; } + done +} + initial_checks() { if [ "x$(whoami)" != "xroot" ]; then perror "ERROR: You need to have root rights to install packages." @@ -284,4 +287,6 @@ REMOTE_AUTOMATIC_BUILD=0 initial_checks read_params $@ +check_devtools + run -- cgit v1.2.3-55-g7522