Replace @rmtry shell implementation with a lua implementation

This way @rmtry is now rootdir friendly
It also allows cross installation (arm rootdir on amd64 host for example)

Reviewed by:	pormtgr (mat)
Differential Revision:	https://reviews.freebsd.org/D23618
This commit is contained in:
Baptiste Daroussin
2020-04-29 14:33:55 +00:00
parent 2f651af0ac
commit 6feec0a337
+4 -6
View File
@@ -2,10 +2,8 @@
#
# MAINTAINER: portmgr@FreeBSD.org
actions: []
post-deinstall: <<EOD
case "%@" in
/*) f="%@" ;;
*) f="%D/%@" ;;
esac
/bin/rm -f ${PKG_ROOTDIR}/$f 2>/dev/null || /usr/bin/true
post-deinstall-lua: <<EOD
file = pkg.prefixed_path("%@")
-- ignore the return value and the error
ret, err = os.remove(file)
EOD