This commit is contained in:
tuxwarrior
2024-05-01 15:50:01 -05:00
parent 9629b4ed53
commit a4a30f2af1

View File

@@ -64,8 +64,8 @@ if [ ${operation} == "update" ] ; then
fi fi
# https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash # https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash
packages_no_comments < sed '/^[[:blank:]]*#/d;s/#.*//' ${x} sed '/^[[:blank:]]*#/d;s/#.*//' ${trg_file} > ${trg_file}.tmp
mapfile -t packages < ${packages_no_comments} mapfile -t packages < ${trg_file}.tmp
installed=$(pacman -Qq) installed=$(pacman -Qq)
list=() list=()
@@ -76,11 +76,9 @@ if [ ${operation} == "update" ] ; then
echo "Skipping (1) $x" echo "Skipping (1) $x"
elif [[ $installed != *$x* ]] elif [[ $installed != *$x* ]]
then then
if [[ $(echo "$installed" | grep -E -o "^$x$") != $x ]] if [[ $(echo "$installed" | grep -E -o "^$x$") != $x ]] then
then echo "Adding $x to list"
#grep -o '^[^#]*' ${x} > x list+="$x "
echo "Adding $x to list"
list+="$x "
else else
echo "Skipping (2) $x" echo "Skipping (2) $x"
fi fi