summarylogtreecommitdiffstats
path: root/paccache-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'paccache-hook.sh')
-rw-r--r--paccache-hook.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/paccache-hook.sh b/paccache-hook.sh
new file mode 100644
index 000000000000..034f05276c04
--- /dev/null
+++ b/paccache-hook.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. /etc/paccache-hook.conf
+
+if [ "$installed" = true ]; then
+ echo "Removing old installed packages..."
+ paccache "-rk${installed_keep:-2}" $extra_args $installed_extra_args
+fi
+
+if [ "$uninstalled" = true ]; then
+ echo "Removing old uninstalled packages..."
+ paccache "-ruk${uninstalled_keep:-0}" $extra_args $uninstalled_extra_args
+fi