From a951e89170510a6877aaa0fd281a30f08106008e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 19:04:49 +0200 Subject: scripts/funtions: run_scripts() on verbose mode add error messages * add the error messages * fix double call to set_initlist * skip empty dirs at start --- scripts/functions | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index 2914aea..81174bf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -88,20 +88,32 @@ set_initlist() { unset initlist for si_x in ${initdir}/*; do + # skip empty dirs without warning + [ "${si_x}" = "${initdir}/*" ] && return + # only allow variable name chars case ${si_x#${initdir}/} in *[![:alnum:]_]*) + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: not alphanumeric or '_' file" continue ;; esac + # skip non executable scripts if [ ! -x ${si_x} ]; then + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: not executable" continue fi + # skip directories if [ -d ${si_x} ]; then + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: a directory" continue fi + initlist="${initlist} ${si_x#${initdir}/}" done } @@ -171,7 +183,6 @@ pop_list_item() reduce_prereqs() { unset runlist - set_initlist set -- ${initlist} i=$# # Loop until there's no more in the queue to loop through -- cgit v1.2.3