Created
January 27, 2018 01:59
-
-
Save vilhalmer/8f0594256dfc6b160790d3bc48ca335e to your computer and use it in GitHub Desktop.
checkupdates IgnorePkg helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
set -o pipefail | |
pending=$(checkupdates) | |
printf '%s\n' "${pending[@]}" | |
pending_names=( $(echo $pending | cut -d' ' -f1) ) | |
ignores=( $(pacconf IgnorePkg) ) | |
affected=() | |
for pkg in $ignores; do | |
effects=$(pactree --linear --depth=1 "$pkg" | grep -Ff <(printf '%s\n' ${pending_names[@]})) | |
if [[ -n $effects ]]; then | |
affected+=($pkg) | |
fi | |
done | |
if [[ -n $affected ]]; then | |
echo "\nIgnored packages are affected by updates:" | |
echo $affected | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment