aboutsummaryrefslogtreecommitdiff
path: root/Keywords
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-22 08:20:07 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-22 08:20:07 +0000
commit45193bf2af2db709b1c3998ddc0cdf1e744d5f94 (patch)
treecca4e49999d8b7d029e2102c879bfbffde018960 /Keywords
parent8f23dbe7abcbf9c0a7f97b7b4a0a27eb3dd73ecf (diff)
downloadports-45193bf2af2db709b1c3998ddc0cdf1e744d5f94.tar.gz
ports-45193bf2af2db709b1c3998ddc0cdf1e744d5f94.zip
Add new keyword rmempty
The goal is to replace all the hand crafted @*unexec test -s XXX && rm by a proper keyword. this keyword is also rootdir compliant Reviewed by: manu, mat Approved by: portmgr (mat) Differential Revision: https://reviews.freebsd.org/D26633
Notes
Notes: svn path=/head/; revision=552943
Diffstat (limited to 'Keywords')
-rw-r--r--Keywords/rmempty.ucl11
1 files changed, 11 insertions, 0 deletions
diff --git a/Keywords/rmempty.ucl b/Keywords/rmempty.ucl
new file mode 100644
index 000000000000..399ff764d163
--- /dev/null
+++ b/Keywords/rmempty.ucl
@@ -0,0 +1,11 @@
+# $FreeBSD$
+#
+# MAINTAINER: portmgr@FreeBSD.org
+actions: []
+pre-deinstall-lua: <<EOD
+ file = pkg.prefixed_path("%@")
+ local st = pkg.stat(file)
+ if st and st.type == "reg" and st.size == 0 then
+ os.remove(file)
+ end
+EOD