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