Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Use sysexits
Matthew Seaman committed 13 years ago
commit d3b96c40a1c2f94177dbba990906a5be3f4a1f7a
parent eb162b4
1 file changed +3 -4
modified pkg/which.c
@@ -50,7 +50,7 @@ exec_which(int argc, char **argv)
	struct pkgdb_it *it = NULL;
	struct pkg *pkg = NULL;
	char pathabs[MAXPATHLEN + 1];
-
	int ret = EPKG_OK, retcode = EPKG_OK;
+
	int ret = EPKG_OK, retcode = EX_OK;
	const char *name, *version, *origin;
	int ch;
	bool orig = false;
@@ -86,7 +86,6 @@ exec_which(int argc, char **argv)
	}

	if ((ret = pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC)) == EPKG_OK) {
-
		retcode = EPKG_OK;
		pkg_get(pkg, PKG_NAME, &name, PKG_VERSION, &version, PKG_ORIGIN, &origin);
		if (quiet && orig)
			printf("%s\n", origin);
@@ -97,11 +96,11 @@ exec_which(int argc, char **argv)
		else if (!quiet && !orig)
			printf("%s was installed by package %s-%s\n", pathabs, name, version);
	} else if (ret != EPKG_END) {
-
		retcode = EPKG_WARN;
+
		retcode = EX_SOFTWARE;
	} else {
		if (!quiet)
			printf("%s was not found in the database\n", pathabs);
-
		retcode = EPKG_WARN;
+
		retcode = EX_DATAERR;
	}
		
	pkg_free(pkg);