bootstrap: Fix initial package installation to work

This commit is contained in:
Marty Oehme 2023-01-16 18:42:42 +01:00
parent 6a0745dedb
commit d56d0148f6
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
4 changed files with 135 additions and 28 deletions

View file

@ -7,7 +7,9 @@
# DESCRIPTION: Display usage information for this script.
# PARAMETERS: see usage function
#==============================================================================
packages="${BOOTSTRAP_PACKAGES:-packages.txt}"
PKG_TSV_FILE=${PKG_TSV_FILE:-bootstrap/packages.tsv}
packages_repo="${BOOTSTRAP_PACKAGES:-$(grep -e ' R ' "$PKG_TSV_FILE" | cut -f1 -d' ' )}"
packages_aur="${BOOTSTRAP_PACKAGES_AUR:-$(grep -e ' A ' "$PKG_TSV_FILE" | cut -f1 -d' ' )}"
main() {
local cmd=""
@ -60,27 +62,16 @@ update_repos() {
install_packages() {
unattended="$1"
if "$unattended"; then
yay -Squ --noconfirm --needed - <"$packages"
echo "$packages_repo" "$packages_aur" | yay -Squ --noconfirm --needed -
else
yay -Su --needed - <"$packages"
fi
}
check_consent() {
echo "This will take a while and install many packages. Proceed [y/N]?"
read -r yes
if [[ "$yes" != y* ]]; then
echo "Exiting."
exit
echo "$packages_repo" | yay -Squ --needed -
echo "$packages_aur" | yay -S --needed -
fi
}
install() {
unattended=$1
echo "Beginning package bootstrap ..............................................."
if ! "$unattended"; then
check_consent
fi
echo "Installing yay ............................................................"
install_yay
echo "Installing apps ..........................................................."