From 1dd1a383faaebafc64038f25bee6780caf3dd79b Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 23 Feb 2017 23:40:55 +0100 Subject: [PATCH] avoid using exit code after dialog; https://github.com/Chrysostomus/manjaro-architect/pull/59 --- lib/util-base.sh | 2 +- lib/util-desktop.sh | 7 ++++--- lib/util-disk.sh | 2 +- lib/util.sh | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index cf2928b..6a010b9 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -123,7 +123,7 @@ set_hostname() { echo "$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hostname 2>$ERR echo -e "#\t\t\n127.0.0.1\tlocalhost.localdomain\tlocalhost\t$(cat \ ${ANSWER})\n::1\tlocalhost.localdomain\tlocalhost\t$(cat ${ANSWER})" > ${MOUNTPOINT}/etc/hosts 2>$ERR - check_for_error "$FUNCNAME" "$?" + check_for_error "$FUNCNAME" 0 } # Adapted and simplified from the Manjaro 0.8 and Antergos 2.0 installers diff --git a/lib/util-desktop.sh b/lib/util-desktop.sh index 9182870..7907cfd 100644 --- a/lib/util-desktop.sh +++ b/lib/util-desktop.sh @@ -210,9 +210,10 @@ install_manjaro_de_wm() { set_sddm_ck elif [[ "$(cat /tmp/.display-manager)" == lightdm ]]; then set_lightdm_greeter - sed -i "s/$(grep "DISPLAYMANAGER=" /mnt/etc/conf.d/xdm)/DISPLAYMANAGER=\"lightdm\"/g" /mnt/etc/conf.d/xdm - arch_chroot "rc-update add xdm default" 2>$ERR + sed -i "s/$(grep "DISPLAYMANAGER=" /mnt/etc/conf.d/xdm)/DISPLAYMANAGER=\"lightdm\"/g" /mnt/etc/conf.d/xdm + arch_chroot "rc-update add xdm default" 2>$ERR check_for_error "add xdm default: lightdm" "$?" + else echo "no display manager was installed" sleep 2 @@ -537,7 +538,7 @@ install_multimedia_menu() { DIALOG " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0 else basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR - check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?" + check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?" fi fi } diff --git a/lib/util-disk.sh b/lib/util-disk.sh index 1f4916f..9862309 100644 --- a/lib/util-disk.sh +++ b/lib/util-disk.sh @@ -436,7 +436,7 @@ mount_partitions() { # If it is already a fat/vfat partition... if [[ $(fsck -N $PARTITION | grep fat) ]]; then DIALOG " $_PrepMntPart " --yesno "$_FormUefiBody $PARTITION $_FormUefiBody2" 0 0 && mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR - check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" + check_for_error "mkfs.vfat -F32 ${PARTITION}" 0 else mkfs.vfat -F32 ${PARTITION} >/dev/null 2>$ERR check_for_error "mkfs.vfat -F32 ${PARTITION}" "$?" diff --git a/lib/util.sh b/lib/util.sh index ac0d852..922738f 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -311,7 +311,7 @@ configure_mirrorlist() { ;; "3") nano /etc/pacman.conf DIALOG " $_MirrorPacman " --yesno "$_MIrrorPacQ" 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0 - check_for_error "edit pacman.conf" "$?" + check_for_error "edit pacman.conf" 0 pacman -Syy ;; *) install_base_menu