From 4c3d59639142595917dcfad661ef50311f7f470e Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Fri, 24 Feb 2017 02:22:57 +0100 Subject: [PATCH] logging system and language info --- bin/manjaro-architect.in | 1 - lib/util.sh | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/manjaro-architect.in b/bin/manjaro-architect.in index 2566e8c..00ff03f 100644 --- a/bin/manjaro-architect.in +++ b/bin/manjaro-architect.in @@ -23,7 +23,6 @@ import ${LIBDIR}/util-desktop.sh import ${LIBDIR}/util-disk.sh id_system -LOG "system: $SYSTEM, init: $H_INIT nw-client: $NW_CMD" select_language mk_connection check_requirements diff --git a/lib/util.sh b/lib/util.sh index 922738f..a3eed00 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -140,7 +140,9 @@ id_system() { fi ## TODO: Test which nw-client is available, including if the service according to $H_INIT is running - [[ $H_INIT == "systemd" ]] && [[ $(systemctl is-active NetworkManager) == "active" ]] && NW_CMD=nmtui + [[ $H_INIT == "systemd" ]] && [[ $(systemctl is-active NetworkManager) == "active" ]] && NW_CMD=nmtui 2>$ERR + + check_for_error "system: $SYSTEM, init: $H_INIT nw-client: $NW_CMD" } # If there is an error, display it and go back to main menu. In any case, write to logfile. @@ -238,9 +240,15 @@ select_language() { DIALOG "$_Config" --infobox "$_ApplySet" 0 0 sleep 2 sed -i "s/#${CURR_LOCALE}/${CURR_LOCALE}/" /etc/locale.gen - locale-gen >/dev/null 2>&1 + locale-gen >/dev/null 2>$ERR export LANG=${CURR_LOCALE} - [[ $FONT != "" ]] && setfont $FONT + + check_for_error "set LANG=${CURR_LOCALE}" "$?" select_language + + [[ $FONT != "" ]] && { + setfont $FONT + check_for_error "set font $FONT" "$?" select_language + } } mk_connection() { @@ -289,8 +297,10 @@ rank_mirrors() { "testing" "-" off \ "unstable" "-" off 2>${BRANCH} clear - [[ ! -z "$(cat ${BRANCH})" ]] && pacman-mirrors -gib "$(cat ${BRANCH})" && \ - check_for_error "$FUNCNAME branch $(cat ${BRANCH})" "$?" + [[ ! -z "$(cat ${BRANCH})" ]] && { + pacman-mirrors -gib "$(cat ${BRANCH})" + check_for_error "$FUNCNAME branch $(cat ${BRANCH})" "$?" configure_mirrorlist + } } # Originally adapted from AIS. Added option to allow users to edit the mirrorlist.