mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
add helper scripts: arch_repopkg_unmonitored
This commit is contained in:
parent
7c20a2ff21
commit
76c834d3d2
2 changed files with 30 additions and 0 deletions
1
scripts/README.rst
Normal file
1
scripts/README.rst
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Additional scripts may help someone.
|
29
scripts/arch_repopkg_unmonitored
Executable file
29
scripts/arch_repopkg_unmonitored
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
if [[ $# -ne 2 || ! -r $1 || -z $2 ]]; then
|
||||||
|
echo >&2 "usage: arch_repopkg_unmonitored config.ini pkg_list or repository_namee"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmp_configured=$(mktemp)
|
||||||
|
tmp_list=$(mktemp)
|
||||||
|
|
||||||
|
trap 'rm -f "$tmp_configured" "$tmp_list"' INT QUIT TERM EXIT
|
||||||
|
|
||||||
|
config=$1
|
||||||
|
if [[ -r $2 ]]; then
|
||||||
|
sort "$2" > "$tmp_list"
|
||||||
|
else
|
||||||
|
pacman -Sl "$2" | cut -d' ' -f2 | sort > "$tmp_list"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Also take commented-out items into account
|
||||||
|
grep -oP '^(?:[;#]\s*)?\[.*(?=]$)' "$config" | sed 's/^\([;#]\s*\)\?\[//' | sort > "$tmp_configured"
|
||||||
|
|
||||||
|
echo ">>> Un-monitored list:"
|
||||||
|
comm -23 "$tmp_list" "$tmp_configured"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo ">>> Monitored but not in list:"
|
||||||
|
comm -13 "$tmp_list" "$tmp_configured"
|
||||||
|
echo
|
Loading…
Add table
Reference in a new issue