Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fail if a keyword file cannot be open
Baptiste Daroussin committed 9 years ago
commit 3ef1269cad1e00a6884a0eef759be81b15b08fe4
parent ef1b2d0
2 files changed +2 -1
modified libpkg/pkg_ports.c
@@ -962,6 +962,7 @@ external_keyword(struct plist *plist, char *keyword, char *line, struct file_att
	if (fd == -1) {
		pkg_emit_error("cannot load keyword from %s: %s",
				keyfile_path, strerror(errno));
+
		return (EPKG_UNKNOWN);
	}

	parser = ucl_parser_new(0);
modified tests/frontend/create.sh
@@ -231,7 +231,7 @@ create_from_plist_with_keyword_arguments_body() {

	atf_check \
		-o empty \
-
		-e inline:"${PROGNAME}: cannot parse keyword: cannot open file ./testkeyword.ucl: No such file or directory\n${PROGNAME}: unknown keyword testkeyword: @testkeyword\n" \
+
		-e inline:"${PROGNAME}: cannot load keyword from ./testkeyword.ucl: No such file or directory\n${PROGNAME}: unknown keyword testkeyword: @testkeyword\n" \
		-s exit:70 \
		pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .