When an error occurs don't hide the cursor

This commit is contained in:
natemaia 2020-05-14 21:40:59 -07:00
parent 3c13a7d676
commit 55db41cb73

View File

@ -249,7 +249,7 @@ declare -A EDIT_FILES=(
# mkfs command flags for filesystem formatting {
declare -A FS_CMD_FLAGS=(
[btrfs]='-f'
[btrfs]='-fq'
[ext2]='-q'
[ext3]='-q'
[ext4]='-q'
@ -1106,7 +1106,9 @@ part_format()
shift 3
msg "File System Format" "\nFormatting $part as $fs\n" 0
mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" > /dev/null 2> "$ERR" ||
mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" > /dev/null 2> "$ERR"
errshow 0 "mkfs.$fs ${FS_CMD_FLAGS[$fs]} '$part'" || return 1
sleep "$delay"
}
@ -1469,7 +1471,7 @@ select_filesystem()
local fs=''
local cur txt pt
cur="$(lsblk -lno FSTYPE "$part" 2> /dev/null)"
txt="\nSelect which file system to use for $part\n\ndefault: ext4"
txt="\nSelect which file system to use for $(part_pretty "$part")\n\ndefault: ext4"
if [[ $cur ]]; then
txt+="\nexisting: $cur"
@ -2376,11 +2378,12 @@ prerun_systemd-boot()
btrfs_name()
{
local txt="$1"
local match="$2"
local default="$2"
local match="$3"
SUBVOL=''
until [[ $SUBVOL ]]; do
dlg SUBVOL input "Btrfs Subvolume Name" "$txt" "" || return 1
dlg SUBVOL input "Btrfs Subvolume Name" "$txt" "$default" || return 1
if [[ -z $SUBVOL ]]; then
return 1
elif [[ $SUBVOL =~ \ |\' || $match == *"$SUBVOL"* || $SUBVOL == "$MVOL" ]]; then
@ -2401,7 +2404,7 @@ btrfs_subvols()
local txt="\nEnter a name for the initial subvolume.\n\nOnce mounted other subvolumes created for"
MVOL=""
btrfs_name "$txt ${mntp:-/} will branch from it." "" || return 1
btrfs_name "$txt ${mntp:-/} will branch from it." "root" || return 1
MVOL="$SUBVOL"
if [[ $mntp ]]; then
@ -2447,7 +2450,7 @@ btrfs_subvols()
until [[ $SUBVOL == '*' ]]; do
local txt="\nEnter a name for subvolume $n within '$MVOL' subvolume."
txt+="\n\nThis process will be repeated until an asterisk (*) is entered as the subvolume name."
btrfs_name "$txt\n\nCreated subvolumes: ${list:-none}\n" "$list" || return 1
btrfs_name "$txt\n\nCreated subvolumes: ${list:-none}\n" "subvol$n" "$list" || return 1
btrfs subvolume create $SUBVOL > /dev/null 2> "$ERR"
errshow 0 "btrfs subvolume create $SUBVOL" || return 1
(( n++ ))
@ -3097,19 +3100,22 @@ errshow()
[ $? -eq 0 ] && return 0
local fatal=$1
shift # always shift off the fatal level arg
shift 1 # always shift off the fatal level arg
local txt
txt="\nCommand: $1\n\n\n\nError:\n$(errmsg)\n\n"
tput cnorm
if (( fatal )); then
yesno "Install Error" "${txt}Errors at this stage must be fixed before the install can continue.\n$_errchoice" "Handle normally" "Continue, it's fixed" ||
return 0
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Install Error " --yes-label "Abort" --no-label "Continue" \
--yesno "${txt}Errors at this stage must be fixed before the install can continue.\n$_errchoice\n" 0 0 || return 0
[[ -r $DBG && $TERM == 'linux' ]] && less "$DBG"
die 1
fi
yesno "Install Error" "${txt}Errors at this stage may be fixed or ignored depending on the error.\n$_errchoice" "Handle normally" "Continue, it's fixed" &&
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Install Error " \
--yesno "${txt}Errors at this stage may not be serious depending on the command and error type.\n$_errchoice\n" 0 0
tput civis
return 1
return 0
}
prechecks()