summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD3
-rw-r--r--unreal-engine-pacman-cache.hook10
2 files changed, 13 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ae9d04e26958..f99ce38cc9ae 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -138,6 +138,9 @@ package() {
fi
install -Dm775 com.unrealengine.UE4Editor.desktop "$pkgdir/usr/share/applications/com.unrealengine.UE4Editor.desktop"
+ ## Install a pacman hook to keep old builds from compounding cache by tens of GBs - 2 builds alone can reach at least 30 GBs in pacman's cache; having one only takes up about 15 GBs
+ install -Dm775 unreal-engine-pacman-cache.hook "${pkgdir}/etc/pacman.d/hooks/unreal-engine-pacman-cache.hook"
+
cd ${pkgname}
# Icon for Desktop entry
diff --git a/unreal-engine-pacman-cache.hook b/unreal-engine-pacman-cache.hook
new file mode 100644
index 000000000000..18517db0e90c
--- /dev/null
+++ b/unreal-engine-pacman-cache.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = unreal-engine-4
+
+[Action]
+Description = Leaving only one Unreal Engine 4 package in cache to save storage space...
+When = PostTransaction
+Exec = /bin/sh -c '/usr/bin/paccache -rvk1 unreal-engine-4'