From 6855cae230bbf8f754d72ca09a80f3c7bee0b84b Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Sat, 18 Jun 2016 19:34:09 -0500 Subject: [PATCH] fix issue where checking for updates notification isnt automatically cleared after updates check has completed --- dist/antergos-iso | 30 ++++++++++++++++++++++-------- iso-hotfix-utility | 6 +++--- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/dist/antergos-iso b/dist/antergos-iso index ab26d49..72ab591 100644 --- a/dist/antergos-iso +++ b/dist/antergos-iso @@ -49,20 +49,33 @@ fi ### pac() { + local exit_status + sudo pacman "$1" --noconfirm --force --needed "${@:2}" + exit_status="$?" + + _2log "pac() ran with args: $*. Exit status was: ${exit_status}" + + return "${exit_status}" } packey() { + local exit_status + sudo pacman-key "$@" + exit_status="$?" + + _2log "packey() ran with args: $*. Exit status was: ${exit_status}" + + return "${exit_status}" } hotfix_setup_environment() { - _2log "[antergos-iso] Setting up environment.." + _2log '[antergos-iso] Setting up environment..' APP_NAME='Cnchi' - LEVEL='critical' APP_ICON='/usr/share/cnchi/data/images/antergos/antergos-icon.png' [[ -f /tmp/.setup-running ]] && CNCHI_STARTED='True' @@ -117,6 +130,8 @@ add_or_remove_antbs_mirrorlist() { fi sudo rm /var/lib/pacman/db.lck > /dev/null 2>&1 + + return 0 } @@ -139,8 +154,9 @@ hotfix_waiting_for_internet() { hotfix_maybe_update() { + _notify_user "${CHECKING_UPDATES}" "${CHECKING_UPDATES_SUB}" add_or_remove_antbs_mirrorlist 'add' - pac -Syy iso-hotfix-utility || populate_pacman_keyring && pac -Syy iso-hotfix-utility + pac -Syy iso-hotfix-utility || { populate_pacman_keyring && pac -Syy iso-hotfix-utility; } } @@ -161,14 +177,12 @@ hotfix_run_when_connected() { local CHECK_UPDATES CHECK_UPDATES=$(sudo checkupdates) - [[ "${CHECK_UPDATES}" = *'cnchi'* ]] && UPDATE_CNCHI='True' - - if [[ ${UPDATE_CNCHI} = 'True' ]]; then + if [[ "${CHECK_UPDATES}" = *'cnchi'* ]]; then notify_user "${INSTALLING_UPDATES}" "${INSTALLING_UPDATES_SUB}" stop_cnchi - pac -S cnchi && LEVEL='normal'; _notify_user "${UPDATE_COMPLETE}" "${UPDATE_COMPLETE_SUB}" + pac -S cnchi && { LEVEL='normal' _notify_user "${UPDATE_COMPLETE}" "${UPDATE_COMPLETE_SUB}"; } else - LEVEL='normal'; notify_no_updates + LEVEL='normal' notify_no_updates fi [[ -f /tmp/.setup-running ]] || start_cnchi diff --git a/iso-hotfix-utility b/iso-hotfix-utility index 28aba63..932a6b2 100644 --- a/iso-hotfix-utility +++ b/iso-hotfix-utility @@ -32,6 +32,8 @@ ## ### +LEVEL='critical' + if [[ -z "${_INITIALIZED}" ]]; then NETWORK_ALIVE=1 NOTIFIED='False' @@ -39,7 +41,6 @@ if [[ -z "${_INITIALIZED}" ]]; then LAST_SENT='' APP_ICON='' APP_NAME='' - LEVEL='' _INITIALIZED='True' fi @@ -109,11 +110,10 @@ _maybe_update_rerun_and_exit() { return fi - _notify_user "${CHECKING_UPDATES}" "${CHECKING_UPDATES_SUB}" hotfix_maybe_update if [[ -f /usr/bin/iso-hotfix-utility ]]; then - { nohup /usr/bin/iso-hotfix-utility & >> "${LOG_PATH}" 2>&1; } && exit 0 + { nohup /usr/bin/iso-hotfix-utility & } && exit 0 else _2log '[iso-hotfix-utility] Failed to update hotifx package!' fi