Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Ask the user to run pkg audit -F only in case of ENOENT failure
Baptiste Daroussin committed 14 years ago
commit 85c5a7ce882f0189c6adc940c56bbecd860f728d
parent 81d985c
1 file changed +5 -1
modified pkg/audit.c
@@ -6,6 +6,7 @@
#include <archive.h>
#include <archive_entry.h>
#include <err.h>
+
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <stdbool.h>
@@ -325,7 +326,10 @@ exec_audit(int argc, char **argv)
	}

	if (parse_db(audit_file, &h) != EPKG_OK) {
-
		warnx("unable to open audit file, try running pkg audit -F first");
+
		if (errno == ENOENT)
+
			warnx("unable to open audit file, try running pkg audit -F first");
+
		else
+
			warn("unable to open audit file %s", audit_file);
		ret = EX_DATAERR;
		goto cleanup;
	}