From 92fb0b78a1a32be142eeed218daf585bec7c741c Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 20 Jun 2024 17:28:19 +0200 Subject: Testing --- install.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 761c6bb..67dddf0 100755 --- a/install.sh +++ b/install.sh @@ -625,16 +625,19 @@ linux_install_packages() { ;; "PORTAGE") # Try installing packages with emerge for Gentoo - local gentoo_packages=("$(yq e '.linux.gentoo[]' "$packages_file" 2>/dev/null)") + local gentoo_packages=("$(yq e '.linux.gentoo[]' "$packages_file" 2>/dev/null | grep -v '^$')") for package in "${gentoo_packages[@]}"; do - if ! equery list "$package" &>/dev/null; then - if ! "$PRIVILEGE_TOOL" emerge --ask "$package"; then - failed_packages+=("$package") - any_failures=true # Set flag to true if any package fails to install + if [ "$package" != "" ]; then # Check if package name is not empty + if ! equery list "$package" &>/dev/null; then + if ! "$PRIVILEGE_TOOL" emerge --ask "$package"; then + failed_packages+=("$package") + any_failures=true # Set flag to true if any package fails to install + fi fi fi done ;; + *) echo "Package manager not supported." return 1 -- cgit v1.2.3