Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
triggers: only defer triggers which will need to execute
Baptiste Daroussin committed 3 months ago
commit 0b5238da3592b110d38c8b8c21799cc0195bd6cd
parent 9b6381d
2 files changed +3 -3
modified libpkg/triggers.c
@@ -463,7 +463,7 @@ trigger_execute_lua(const char *script, bool sandbox, pkghash *args)
	int pstat;
	pkghash_it it;

-
	if (ctx.defer_triggers) {
+
	if (!sandbox && ctx.defer_triggers) {
		save_trigger(script, sandbox, args);
		return (EPKG_OK);
	}
modified tests/frontend/triggers.sh
@@ -46,6 +46,7 @@ deferred_body() {
path_glob: [ "/*" ]
trigger: {
	type: lua
+
	sandbox: false
	script: <<EOS
	print("deferred " .. arg[1])
EOS
@@ -57,8 +58,7 @@ EOF
	unset PKG_TRIGGERS_DIR
	unset PKG_DBDIR
	atf_check pkg -o REPOS_DIR=/dev/null -o PKG_TRIGGERS_DIR="/trigger_dir" -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
-
OUTPUT='--sandbox
-
--begin args
+
OUTPUT='--begin args
-- /trigger_dir
--end args
--