From cd42c9128f3795581329b3e7751eb289a55c6561 Mon Sep 17 00:00:00 2001 From: esche Date: Mon, 30 Sep 2024 20:43:31 +0200 Subject: [PATCH] restructure --- etc/pacman.d/hooks/orphans.hook | 10 ++++++++++ etc/pacman.d/hooks/paccache.hook | 11 +++++++++++ etc/pacman.d/hooks/paccache2.hook | 11 +++++++++++ etc/pacman.d/hooks/unneeded.hook | 10 ++++++++++ 4 files changed, 42 insertions(+) create mode 100644 etc/pacman.d/hooks/orphans.hook create mode 100644 etc/pacman.d/hooks/paccache.hook create mode 100644 etc/pacman.d/hooks/paccache2.hook create mode 100644 etc/pacman.d/hooks/unneeded.hook diff --git a/etc/pacman.d/hooks/orphans.hook b/etc/pacman.d/hooks/orphans.hook new file mode 100644 index 0000000..37efbe1 --- /dev/null +++ b/etc/pacman.d/hooks/orphans.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Remove +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = List orphans +When = PostTransaction +Exec = /usr/bin/bash -c "(pacman -Qtd && echo 'uninstall all with »pacman -Qtdq | pacman -Rs -«') || echo '==> None found'" diff --git a/etc/pacman.d/hooks/paccache.hook b/etc/pacman.d/hooks/paccache.hook new file mode 100644 index 0000000..d295299 --- /dev/null +++ b/etc/pacman.d/hooks/paccache.hook @@ -0,0 +1,11 @@ +[Trigger] +Operation = Remove +Operation = Install +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Keep the last cache of currently installed packages +When = PostTransaction +Exec = /usr/bin/paccache -r diff --git a/etc/pacman.d/hooks/paccache2.hook b/etc/pacman.d/hooks/paccache2.hook new file mode 100644 index 0000000..f3ce596 --- /dev/null +++ b/etc/pacman.d/hooks/paccache2.hook @@ -0,0 +1,11 @@ +[Trigger] +Operation = Remove +Operation = Install +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Delete cache of uninstalled packages +When = PostTransaction +Exec = /usr/bin/paccache -ruk1 diff --git a/etc/pacman.d/hooks/unneeded.hook b/etc/pacman.d/hooks/unneeded.hook new file mode 100644 index 0000000..732ea5a --- /dev/null +++ b/etc/pacman.d/hooks/unneeded.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Remove +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Possibly unneeded packages (e.g. dependency cycles) +When = PostTransaction +Exec = /usr/bin/bash -c "(pacman -Qqd | pacman -Rsup - && echo 'uninstall all with »pacman -Qqd | pacman -Rsu -«') || echo '==> None found'"