Skip to content

Commit

Permalink
fix: Filter out ignored packages when checking for AUR packages updat…
Browse files Browse the repository at this point in the history
…e with paru (#305)

`paru` still shows packages listed in pacman.conf's `IgnorePkg` array when checking for update with `-Qua`, creating false positives when checking for updates with `arch-update`.
This commit properly filters out packages tagged as `[ignored]` from the `paru` output to prevent such false positives.

*For information, `pikaur` also shows packages listed in `IgnorePkg` in its output but in `stderr`, which is already filtered out by `arch-update` (so no fix needed for `pikaur`). `yay` completely ignores packages listed in `IgnorePkg` already (just like `checkupdates` does for packages from the repos).*

Fixes #304
  • Loading branch information
Antiz96 authored Jan 22, 2025
1 parent 2646056 commit 8252253
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later

if [ -n "${aur_helper}" ] && [ -n "${flatpak_support}" ]; then
update_available=$(checkupdates ; "${aur_helper}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' ; flatpak update | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')
update_available=$(checkupdates ; "${aur_helper}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' | grep -vw "\[ignored\]$" ; flatpak update | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')
elif [ -n "${aur_helper}" ] && [ -z "${flatpak_support}" ]; then
update_available=$(checkupdates ; "${aur_helper}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g')
update_available=$(checkupdates ; "${aur_helper}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' | grep -vw "\[ignored\]$")
elif [ -z "${aur_helper}" ] && [ -n "${flatpak_support}" ]; then
update_available=$(checkupdates ; flatpak update | sed -n '/^ 1./,$p' | awk '{print $2}' | grep -v '^$' | sed '$d')
else
Expand Down
4 changes: 2 additions & 2 deletions src/lib/list_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ fi
if [ -n "${aur_helper}" ]; then
if [ -z "${no_version}" ]; then
# shellcheck disable=SC2154
aur_packages=$("${aur_helper}" --color "${pacman_color_opt}" "${devel_flag[@]}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g')
aur_packages=$("${aur_helper}" --color "${pacman_color_opt}" "${devel_flag[@]}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' | grep -vw "\[ignored\]$")
else
# shellcheck disable=SC2154
aur_packages=$("${aur_helper}" --color "${pacman_color_opt}" "${devel_flag[@]}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' | awk '{print $1}')
aur_packages=$("${aur_helper}" --color "${pacman_color_opt}" "${devel_flag[@]}" -Qua 2> /dev/null | sed 's/^ *//' | sed 's/ \+/ /g' | grep -vw "\[ignored\]$" | awk '{print $1}')
fi
fi

Expand Down

0 comments on commit 8252253

Please sign in to comment.