From f1b9165bd5e8ab3636c581ba1442c4ba5c207911 Mon Sep 17 00:00:00 2001 From: natemaia Date: Fri, 24 Apr 2020 00:42:30 -0700 Subject: [PATCH] Fix issue with package install --- archlabs-installer | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/archlabs-installer b/archlabs-installer index 35384a5..ec28878 100755 --- a/archlabs-installer +++ b/archlabs-installer @@ -7,7 +7,7 @@ # shellcheck disable=SC2086,SC2046 -VER=2.1.30 +VER=2.1.31 # default values { @@ -487,7 +487,7 @@ select_sessions() [[ $INSTALL_WMS ]] || return 0 for i in ${INSTALL_WMS/dwm/}; do - WM_PKGS+=("$i") + USERWM_PKGS+=("$i") done for i in $INSTALL_WMS; do @@ -499,14 +499,14 @@ select_sessions() fi if [[ ${WM_EXT[$i]} ]]; then for j in ${WM_EXT[$i]}; do - [[ ${WM_PKGS[*]} != *"$j"* ]] && WM_PKGS+=("$j") + [[ ${USERWM_PKGS[*]} != *"$j"* ]] && USERWM_PKGS+=("$j") done fi done select_login || return 1 - for pkg in "${WM_PKGS[@]}"; do + for pkg in "${USERWM_PKGS[@]}"; do [[ ${PACKAGES[*]} != *"$pkg"* ]] && PACKAGES+=("$pkg") done @@ -605,6 +605,7 @@ select_packages() if [[ $UPKGS ]]; then # add any needed PKG_EXT to the list for i in $UPKGS; do + [[ ${USER_PKGS[*]} != *"$i"* ]] && USER_PKGS+=("$i") if [[ ${PKG_EXT[$i]} ]]; then for j in ${PKG_EXT[$i]}; do [[ ${USER_PKGS[*]} != *"$j"* ]] && USER_PKGS+=("$j") @@ -1428,7 +1429,7 @@ install_cleanup() [[ $LOGIN_WM == 'dwm' ]] && sed -i '/super/d; /picom/d' "$MNT/home/$user/.xprofile" "$MNT/root/.xprofile" # remove some commands from ~/.xprofile when using self contained sessions - if [[ $LOGIN_WM =~ ($SELF_CONTAINED_SES) || ($LOGIN_TYPE != 'xinit' && ${WM_PKGS[*]} =~ ($SELF_CONTAINED)) ]]; then + if [[ $LOGIN_WM =~ ($SELF_CONTAINED_SES) || ($LOGIN_TYPE != 'xinit' && ${USERWM_PKGS[*]} =~ ($SELF_CONTAINED)) ]]; then sed -i '/super/d; /nitrogen/d; /picom/d' "$MNT/home/$user/.xprofile" "$MNT/root/.xprofile" fi @@ -1516,21 +1517,21 @@ install_packages() if [[ $NEWSHELL == 'zsh' ]]; then inpkg+=("zsh-completions") elif [[ $PACSTRAP != 1 ]]; then - rmpkg+=("archlabs-installer" "zsh") + rmpkg+=("zsh") + fi + + if [[ $PACSTRAP != 1 ]] && pacman -Qq archlabs-installer >/dev/null 2>&1; then + rmpkg+=("archlabs-installer") fi # update and install crucial packages first to avoid issues chrun "pacman -Syyu --noconfirm" 2> "$ERR" 2>&1 errshow 1 "chrun 'pacman -Syyu --noconfirm'" - chrun "pacman -S ${BASE_PKGS[*]} ${loginpkg[*]} $NEWSHELL --noconfirm --needed" 2> "$ERR" 2>&1 - errshow 1 "chrun 'pacman -S ${BASE_PKGS[*]} ${loginpkg[*]} $NEWSHELL --noconfirm --needed'" - if [[ $PACSTRAP == 1 ]]; then - chrun "pacman -S ${ISO_PKGS[*]} --noconfirm --needed" 2> "$ERR" 2>&1 - errshow 1 "chrun 'pacman -S ${ISO_PKGS[*]} --noconfirm --needed'" - fi + chrun "pacman -S ${BASE_PKGS[*]} ${loginpkg[*]} $NEWSHELL $UCODE $KERNEL --noconfirm --needed" 2> "$ERR" 2>&1 + errshow 1 "chrun 'pacman -S ${BASE_PKGS[*]} ${loginpkg[*]} $NEWSHELL $UCODE $KERNEL --noconfirm --needed'" # reinstalling iputils fixes the network issue for non-root users - chrun "pacman -S iputils $UCODE $KERNEL --noconfirm" + # chrun "pacman -S iputils --noconfirm" # remove the packages we don't want on the installed system [[ ${rmpkg[*]} ]] && chrun "pacman -Rnsc ${rmpkg[*]} --noconfirm" @@ -1725,7 +1726,7 @@ install_background() PACSTRAP=1 ( install_mirrorlist "/etc/pacman.d/mirrorlist" > /tmp/bgout 2>&1 && - pacstrap /mnt ${BASE_PKGS[*]} > /tmp/bgout 2>&1 && + pacstrap /mnt ${BASE_PKGS[*]} ${ISO_PKGS[*]} > /tmp/bgout 2>&1 && cp /etc/pacman.d/mirrorlist "$MNT/etc/pacman.d/mirrorlist" cp /etc/pacman.conf "$MNT/etc/pacman.conf" al_repo "$MNT/etc/pacman.conf"