summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKopfKrieg2017-06-30 16:30:00 +0200
committerKopfKrieg2017-06-30 16:33:53 +0200
commit97610103c58845678b3f0055ff86db5fbea037ac (patch)
tree1cd04ac0de396d531ae1f4e40540363a2e772642
downloadaur-97610103c58845678b3f0055ff86db5fbea037ac.tar.gz
Initial v0.1 of the pacman cleanup hook
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD17
-rw-r--r--cleanup.hook11
3 files changed, 39 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..434182547b6d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,11 @@
+pkgbase = pacman-cleanup-hook
+ pkgdesc = Pacman hook to cleanup pacman cache, keeps only the latest cache and the currently installed package. No configuration necessary, just install it.
+ pkgver = 0.1
+ pkgrel = 1
+ arch = any
+ depends = pacman
+ source = cleanup.hook
+ sha1sums = 8352fc69232b9ae2fea24672c15e103fff80a5d4
+
+pkgname = pacman-cleanup-hook
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..68701ad93843
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,17 @@
+# Maintainer: KopfKrieg <archlinux [at] absolem [dot] cc>
+
+pkgname=pacman-cleanup-hook
+pkgver=0.1
+pkgrel=1
+pkgdesc="Pacman hook to cleanup pacman cache, keeps only the latest cache and the currently installed package. No configuration necessary, just install it."
+arch=("any")
+depends=("pacman")
+source=("cleanup.hook")
+sha1sums=("8352fc69232b9ae2fea24672c15e103fff80a5d4")
+
+package() {
+ mkdir -p "${pkgdir}/etc/pacman.d/hooks"
+ cp "${srcdir}/cleanup.hook" "${pkgdir}/etc/pacman.d/hooks/cleanup.hook"
+ chmod 0644 "${pkgdir}/etc/pacman.d/hooks/cleanup.hook"
+ chown root:root "${pkgdir}/etc/pacman.d/hooks/cleanup.hook"
+}
diff --git a/cleanup.hook b/cleanup.hook
new file mode 100644
index 000000000000..bfd7b86d8634
--- /dev/null
+++ b/cleanup.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Remove
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = *
+
+[Action]
+Description = Keep the last cache and the currently installed.
+When = PostTransaction
+Exec = /usr/bin/paccache -rvk2