diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-14 19:02:47 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-14 19:02:47 +0100 |
commit | c2666130a6170b7f2c4d5bd5dde64fb4035275e0 (patch) | |
tree | f5f986b201043ad23f6ad83f495b8d5a36a85f3a /src/core/procedures/interactive | |
parent | 801b3d4a7f925e7b9ad63f795f7a7bdc92fd75a7 (diff) |
make rollback more accessible, assist user more when he needs it and when not + some output cleanup
Diffstat (limited to 'src/core/procedures/interactive')
-rw-r--r-- | src/core/procedures/interactive | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index d4edfc6..4e90854 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -7,7 +7,7 @@ depend_procedure core base # esp for auto_{network,locale,fstab}, intro and set_ var_TARGET_DIR="/mnt" EDITOR= - +BLOCK_ROLLBACK_USELESS=1 # clock HARDWARECLOCK= @@ -136,7 +136,8 @@ worker_prepare_disks() ret=1 # 1 means unsuccessful. 0 for ok NEXTITEM= DISK_CONFIG_TYPE= - + rollbackstr=" (you don't need to do this)" + ended_ok worker prepare_disks && rollbackstr=" (looks like you need to do this)" && show_warning "Rollback may be needed" "It seems you already went here. You should probably rollback previous changes before reformatting, otherwise stuff will probably fail" while [ "$DONE" = "0" ] do default=no @@ -146,11 +147,12 @@ worker_prepare_disks() "1" "Auto-Prepare (erases the ENTIRE hard drive and sets up partitions and filesystems)" \ "2" "Partition Hard Drives" \ "3" "Configure block devices, filesystems and mountpoints" \ - "4" "Return to Main Menu" + "4" "Rollback last changes$rollbackstr" \ + "5" "Return to Main Menu" case $ANSWER_OPTION in "1") - interactive_autoprepare && NEXTITEM=4 && ret=0 && DISK_CONFIG_TYPE=auto;; #TODO: for some reason. if this completes $?=0, next item will be 1 :/ + interactive_autoprepare && NEXTITEM=5 && ret=0 && DISK_CONFIG_TYPE=auto;; #TODO: for some reason. if this completes $?=0, next item will be 1 :/ "2") if [ "$DISK_CONFIG_TYPE" = "auto" ]; then notify "You have already prepared your filesystems with Auto-prepare" #TODO: allow user to do this anyway. he can change his mind. @@ -163,9 +165,23 @@ worker_prepare_disks() if [ "$DISK_CONFIG_TYPE" = "auto" ]; then notify "You have already prepared your filesystems with Auto-prepare" #TODO: allow user to do this anyway. he can change his mind. else - interactive_filesystems && ret=0 && NEXTITEM=4 && DISK_CONFIG_TYPE=manual + interactive_filesystems && ret=0 && NEXTITEM=5 && DISK_CONFIG_TYPE=manual fi ;; + "4" + if [ "$BLOCK_ROLLBACK_USELESS" = "1" ] + then + ask_yesno "It seems like you haven't partitioned/formatted/mounted anything yet (or rolled back already). This operation is useless (unless the installer is buggy), but it doesn't harm. Do you want to continue?" || NEXTITEM=5 + fi + if [ $? -eq 0 -o "$BLOCK_ROLLBACK_USELESS" = "0" ] + then + if rollback_filesystems #TODO: this part doesn't belong here. move it to ui-interactive. (interactive_rollback) + then + infofy "Rollback succeeded" + else + show_warning "Rollback failed" "Rollback failed" + fi + fi *) DONE=1 ;; esac |