diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-12 15:47:17 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-12 15:47:17 +0100 |
commit | a75015944ef7a878254e40964cd7c1c540b9655f (patch) | |
tree | 9c6609fd56004ab074eaf9c5b7bd23b6389fbc5b /src/core | |
parent | a7770bc688e5dca68ffaeeb9d13b3a7ba04c2730 (diff) |
use ended_ok in check_depend + cleaner checking if grub already done successfully
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index f7f2f18..4c0f8e8 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -9,11 +9,11 @@ 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 - debug "Depending on exit state of $objecct.. looking up -> ${!exit_var}" - [ "${!exit_var}" = '0' ] && return 0 - show_warning "Cannot Continue. Going back to $2" "You must do $2 first before going here!." && return 1 + ended_ok $1 $2 && return 0 + subject="$1 $2" + title=worker_$1_$2_title + [ -n "${!title}" ] && subject="'${!title}'" + show_warning "Cannot Continue. Going back to $2" "You must do $subject first before going here!." && return 1 } @@ -525,7 +525,8 @@ interactive_install_grub() { [ ! -f $grubmenu ] && show_warning "No grub?" "Error: Couldn't find $grubmenu. Is GRUB installed?" && return 1 # try to auto-configure GRUB... - if [ "$PART_ROOT" != "" -a "$S_GRUB" != "1" ]; then + if [ -n "$PART_ROOT" -a "$GRUB_OK" != '1' ] ; then + GRUB_OK=0 grubdev=$(mapdev $PART_ROOT) local _rootpart="${PART_ROOT}" local _uuid="$(getuuid ${PART_ROOT})" @@ -634,6 +635,7 @@ EOF return 1 fi notify "GRUB was successfully installed." + GRUB_OK=1 return 0 } |