u
This commit is contained in:
@@ -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"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user