aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2024-06-20 17:28:19 +0200
committersrdusr <trevorgray@srdusr.com>2024-06-20 17:28:19 +0200
commit92fb0b78a1a32be142eeed218daf585bec7c741c (patch)
tree2cb4bd5775b9624abdc09e469ffde96cd40cbbfb
parentb67ee68edd42c673ec4ca1be53239dd665ed9d6d (diff)
downloaddotfiles-92fb0b78a1a32be142eeed218daf585bec7c741c.tar.gz
dotfiles-92fb0b78a1a32be142eeed218daf585bec7c741c.zip
Testing
-rwxr-xr-xinstall.sh13
1 files 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