Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Return exit status 1 for additional cases
Stefan Eßer committed 4 years ago
commit 1cec8b5827edec20efc83958a19858d99f2f7455
parent da1a478
2 files changed +2 -2
modified src/query.c
@@ -1024,7 +1024,7 @@ exec_query(int argc, char **argv)
		i++;
	} while (i < argc);

-
	if (nprinted == 0 && condition_sql == NULL && retcode == EXIT_SUCCESS) {
+
	if (nprinted == 0 && match != MATCH_ALL && retcode == EXIT_SUCCESS) {
		/* ensure to return a non-zero status when no package
		 were found. */
		retcode = EXIT_FAILURE;
modified tests/frontend/query.sh
@@ -81,7 +81,7 @@ EOF
	atf_check \
		-o empty \
		-e empty \
-
		-s exit:0 \
+
		-s exit:1 \
		pkg query -e "%#r>0" "%n: %rn %rv %ro" plop

	atf_check \