Fix: duplicate pakcages being added in absurd quantity

This commit is contained in:
natemaia 2019-01-11 17:44:14 -08:00
parent 425a26d88a
commit 6a3f9f2885

View File

@ -8,7 +8,7 @@
# Some ideas and code has been taken from other installers # Some ideas and code has been taken from other installers
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due # AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
VER="1.8.11" # version VER="1.8.12" # version
DIST="ArchLabs" # distributor DIST="ArchLabs" # distributor
MNT="/mnt" # mountpoint MNT="/mnt" # mountpoint
@ -70,6 +70,7 @@ show_cfg()
local cmd="${BCMDS[$BOOTLDR]}" local cmd="${BCMDS[$BOOTLDR]}"
local mnt="${BMNTS[$SYS-$BOOTLDR]}" local mnt="${BMNTS[$SYS-$BOOTLDR]}"
local pkgs="${PACKAGES# }" local pkgs="${PACKAGES# }"
pkgs="${pkgs# }"
msgbox "$_PrepTitle" " msgbox "$_PrepTitle" "
---------- PARTITION CONFIGURATION ------------ ---------- PARTITION CONFIGURATION ------------
@ -265,6 +266,8 @@ select_timezone()
select_wm_or_de() select_wm_or_de()
{ {
LOGIN_CHOICES=""
tput civis tput civis
if ! INSTALL_WMS="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \ if ! INSTALL_WMS="$(dialog --cr-wrap --no-cancel --stdout --backtitle "$BT" \
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \ --title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
@ -287,7 +290,7 @@ select_wm_or_de()
# packages needed for the selected WMs/DEs # packages needed for the selected WMs/DEs
for wm in $INSTALL_WMS; do for wm in $INSTALL_WMS; do
LOGIN_CHOICES+="$wm - " LOGIN_CHOICES+="$wm - "
[[ ${WM_EXT[$wm]} ]] && WM_PACKAGES+=" ${WM_EXT[$wm]}" [[ ${WM_EXT[$wm]} && $WM_PACKAGES != *"${WM_EXT[$wm]}"* ]] && WM_PACKAGES+=" ${WM_EXT[$wm]}"
done done
# choose how to log in # choose how to log in
@ -307,7 +310,7 @@ select_wm_or_de()
fi fi
# add packages to the main package list # add packages to the main package list
PACKAGES+=" ${WM_PACKAGES# }" [[ $PACKAGES ]] && PACKAGES+=" ${WM_PACKAGES# }" || PACKAGES="${WM_PACKAGES# }"
} }
select_login() select_login()
@ -368,14 +371,14 @@ select_packages()
# add any extras for each package # add any extras for each package
for pkg in $PACKAGES; do for pkg in $PACKAGES; do
[[ ${PKG_EXT[$pkg]} ]] && PACKAGES+=" ${PKG_EXT[$pkg]}" [[ ${PKG_EXT[$pkg]} && $PACKAGES != *"${PKG_EXT[$pkg]}"* ]] && PACKAGES+=" ${PKG_EXT[$pkg]}"
done done
# add mksh to package list if it was chosen as the login shell # add mksh to package list if it was chosen as the login shell
[[ $MYSHELL == *mksh ]] && PACKAGES+=" mksh" [[ $MYSHELL == *mksh ]] && PACKAGES+=" mksh"
# remove duplicates and leading spaces # remove leading space
PACKAGES="$(uniq <<< "${PACKAGES/^ /}")" PACKAGES="${PACKAGES# }"
return 0 return 0
} }
@ -1013,7 +1016,7 @@ select_mountpoint()
fi fi
# bad mountpoint # bad mountpoint
if [[ ${EXTRA_MNT:0:1} != "/" || ${#EXTRA_MNT} -le 1 || $EXTRA_MNT =~ \ |\' ]]; then if [[ ${EXTRA_MNT:0:1} != "/" || ${#EXTRA_MNT} -le 1 || $EXTRA_MNT =~ \ |\' || $EXTRA_MNTS == *"$EXTRA_MNT"* ]]; then
msgbox "$_ErrTitle" "$_ExtErrBody" msgbox "$_ErrTitle" "$_ExtErrBody"
select_mountpoint || return 1 select_mountpoint || return 1
fi fi
@ -1037,10 +1040,7 @@ select_mount_opts()
fi fi
MNT_OPTS="$(sed 's/ /,/g; $s/,$//' <<< "$MNT_OPTS" )" MNT_OPTS="$(sed 's/ /,/g; $s/,$//' <<< "$MNT_OPTS" )"
yesno "$title" "$_MntConfBody $MNT_OPTS\n" || { select_mount_opts "$part" "$fs" || return 1; }
if ! yesno "$title" "$_MntConfBody $MNT_OPTS\n"; then
select_mount_opts "$part" "$fs" || return 1
fi
return 0 return 0
} }