From 49c8eac6bea0094ce58860bc09d5c369e6c718c1 Mon Sep 17 00:00:00 2001 From: tuxwarrior Date: Wed, 1 May 2024 15:56:09 -0500 Subject: [PATCH] u --- scripts/99_software.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/99_software.sh b/scripts/99_software.sh index 451ae2e..dc91261 100644 --- a/scripts/99_software.sh +++ b/scripts/99_software.sh @@ -63,12 +63,15 @@ if [ ${operation} == "update" ] ; then exit 1 fi - # https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash + # https://unix.stackexchange.com/questions/157328/how-can-i-remove-all-comments-from-a-file sed '/^[[:blank:]]*#/d;s/#.*//' ${trg_file} > ${trg_file}.tmp + + # https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash mapfile -t packages < ${trg_file}.tmp installed=$(pacman -Qq) list=() + list_aur=() for x in ${packages[@]} do if [[ $installed == *$x* ]] @@ -77,8 +80,12 @@ if [ ${operation} == "update" ] ; then elif [[ $installed != *$x* ]] then if [[ $(echo "$installed" | grep -E -o "^$x$") != $x ]] then - echo "Adding $x to list" - list+="$x " + if [[ "$x" =~ ^aur:* ]]; then + echo "Adding $x to aur list" + else + echo "Adding $x to normal list" + list+="$x " + fi else echo "Skipping (2) $x" fi