]> git.rmz.io Git - dotfiles.git/commitdiff
bin: aur utils command to remove pkgs from local repos
authorSamir Benmendil <me@rmz.io>
Mon, 19 Sep 2022 10:42:58 +0000 (11:42 +0100)
committerSamir Benmendil <me@rmz.io>
Mon, 19 Sep 2022 10:42:58 +0000 (11:42 +0100)
bin/aur-remove [new file with mode: 0755]

diff --git a/bin/aur-remove b/bin/aur-remove
new file mode 100755 (executable)
index 0000000..3885a05
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh --
+# aur-remove - remove listed packages from all local repositories
+# Taken from "man aur'
+
+if [ "$#" -eq 0 ]; then
+    printf 'usage: aur remove package [package ...]\n' >&2
+    exit 1
+fi
+
+aur repo --list-path | while read -r repo_path; do
+    repo-remove "$repo_path" "$@"
+    paccache -c "${repo_path%/*}" -rvk0 "$@"
+done