Skip to content

Instantly share code, notes, and snippets.

@vilhalmer
Created January 27, 2018 01:59
Show Gist options
  • Save vilhalmer/8f0594256dfc6b160790d3bc48ca335e to your computer and use it in GitHub Desktop.
Save vilhalmer/8f0594256dfc6b160790d3bc48ca335e to your computer and use it in GitHub Desktop.
checkupdates IgnorePkg helper
#!/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