diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-11 21:31:00 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-11 21:31:00 +0100 |
commit | 392e855ceae3fc17584761c79a8d0e5616ed088f (patch) | |
tree | 925ed947009493dac3809edcc01a10e958ad2065 /src/core/libs | |
parent | 906aab0e2fb89e5d0ab128239045b82f5cb3c3a4 (diff) |
first version of new "dependency" checking and tracking (flow control) in core/interactive + better nextitem setting + tmp_fstab fix
Diffstat (limited to 'src/core/libs')
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 123415a..9dc9a93 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1,6 +1,21 @@ #!/bin/sh #TODO: get backend code out of here!! + +# check if a worker has completed successfully. if not -> tell user he must do it + return 1 +# if ok -> don't warn anything and return 0 +check_depend () +{ + [ -z "$1" -o -z "$2" ] && die_error "Use the check_depend function like this: check_depend <type> <name> with type=phase/worker" + [ "$1" != phase -a "$1" != worker ] && die_error "check_depend's first argument must be a valid type (phase/worker)" + + object=$1_$2 + exit_var=exit_$object + [ "${!exit_var}" = '0' ] && return 0 + show_warning "Cannot Continue. Going back to $2" "You must do $2 first before going here!." && return 1 +} + + interactive_partition() { target_umountall @@ -289,7 +304,7 @@ EOF interactive_mountpoints() { while [ "$PARTFINISH" != "DONE" ]; do - : >/$TMP_FSTAB + : >$TMP_FSTAB : >/tmp/.parts # Determine which filesystems are available |