From 3ca57b4545d517cb2279b2515d3da706bfafb02e Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Thu, 30 Oct 2003 17:28:29 +0000 Subject: [PATCH] added 'checkComponents()' function git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@338 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/functions | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/util-vserver/scripts/functions b/util-vserver/scripts/functions index f9215f7..32a1bc7 100644 --- a/util-vserver/scripts/functions +++ b/util-vserver/scripts/functions @@ -293,3 +293,32 @@ function getFileArray local IFS=$_VS_NEWLINE eval "$1"='( $(< "$2") )' } + +function checkComponents +{ + local i + local msg=$1 + local x_failed= + + shift + + for i; do + local failed= + case "$i" in + core) test -x "$_CHBIND" || failed=1;; + build) test -x "$_VSERVER_BUILD" || failed=1;; + sysv) test -x "$INITRDDIR/vserver" || failed=1;; + devel) test -d "$INCLUDEDIR/vserver.h" || failed=1;; + *) echo "Unknown component '$i'" + return false + ;; + esac + + test -z "$failed" || { + echo "$msg: $i" + x_failed=1 + } + done + + test -z "$x_failed" +} -- 1.8.1.5