summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2017-04-08 23:55:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2017-04-10 17:26:33 +0200
commit601fcd25268889138b7228ce932416d59d11c7eb (patch)
tree60f23eb70dd5ba18fcf0d4330e0aa0f8b397cb01
parentf5bf444d432b69b3ef11b43f752a82f2a3bcc57f (diff)
Cleanup the package cache after install or upgrade
-rw-r--r--rootfs/etc/pacman.conf1
-rw-r--r--rootfs/usr/share/libalpm/hooks/package-cleanup.hook11
2 files changed, 11 insertions, 1 deletions
diff --git a/rootfs/etc/pacman.conf b/rootfs/etc/pacman.conf
index 4a79cbd..9b7b455 100644
--- a/rootfs/etc/pacman.conf
+++ b/rootfs/etc/pacman.conf
@@ -1,5 +1,4 @@
[options]
-CacheDir = /tmp/pacman/pkg
Architecture = auto
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
diff --git a/rootfs/usr/share/libalpm/hooks/package-cleanup.hook b/rootfs/usr/share/libalpm/hooks/package-cleanup.hook
new file mode 100644
index 0000000..e8e28a7
--- /dev/null
+++ b/rootfs/usr/share/libalpm/hooks/package-cleanup.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = *
+
+[Action]
+Description = Cleaning up package cache...
+Depends = coreutils
+When = PostTransaction
+Exec = /usr/bin/rm -rf /var/cache/pacman/pkg /var/lib/pacman/sync