From cd42c091213e11d5ec480ef8c7f03c94a12d7cc9 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 5 Apr 2010 16:32:17 +0200 Subject: make sure to create the parent directories for the logfiles in lib-misc run_background and run_controlled. this caused breakage now since libui logs to another directory --- src/core/libs/lib-misc.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 113555f..681cf70 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -15,6 +15,10 @@ run_controlled () [ -z "$3" ] && die_error "run_controlled needs a logfile to redirect output to!" [ -z "$4" ] && die_error "run_controlled needs a title to show while your process is running!" + log_parent=$(dirname $3) + if [ ! -d $log_parent ]; then + mkdir -p $log_parent || die_error "Could not create $log_parent, we were asked to log $1 to $3" + fi if [ "$var_UI_TYPE" = dia ] then run_background $1 "$2" $3 @@ -41,6 +45,11 @@ run_background () [ -z "$2" ] && die_error "run_background needs a command to execute!" [ -z "$3" ] && die_error "run_background needs a logfile to redirect output to!" + log_parent=$(dirname $3) + if [ ! -d $log_parent ]; then + mkdir -p $log_parent || die_error "Could not create $log_parent, we were asked to log $1 to $3" + fi + debug 'MISC' "run_background called. identifier: $1, command: $2, logfile: $3" ( \ touch $RUNTIME_DIR/aif-$1-running -- cgit v1.2.3-54-g00ecf