diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-04-05 16:32:17 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-04-05 16:32:17 +0200 |
commit | cd42c091213e11d5ec480ef8c7f03c94a12d7cc9 (patch) | |
tree | efbdb084b004a081c5fe7c59164990231aabcf28 | |
parent | eee1eb1217d4ed044b1f9816dc5eead49cc5d7d6 (diff) |
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
-rw-r--r-- | src/core/libs/lib-misc.sh | 9 |
1 files changed, 9 insertions, 0 deletions
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 |