Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a new error type, EPKG_NOTINSTALLED, for handling when packages are not installed. Use the new error type to so that error messages are a little clearer.
Brad Davis committed 10 years ago
commit 113b075893c4d234d9459ed24cadfa61070af94c
parent 84361ab
2 files changed +7 -3
modified libpkg/pkg.h.in
@@ -486,7 +486,11 @@ typedef enum {
	/**
	 * Need to repeat operation
	 */
-
	EPKG_AGAIN
+
	EPKG_AGAIN,
+
	/**
+
	 * Not installed
+
	 */
+
	EPKG_NOTINSTALLED
} pkg_error_t;

/**
modified libpkg/pkg_jobs.c
@@ -1013,7 +1013,7 @@ pkg_jobs_find_remote_pattern(struct pkg_jobs *j, struct job_pattern *jp)
			if (pkg_jobs_check_local_pkg(j, jp) != EPKG_OK) {
				pkg_emit_error("%s is not installed, therefore upgrade is impossible",
						jp->pattern);
-
				return (EPKG_FATAL);
+
				return (EPKG_NOTINSTALLED);
			}
		}
		rc = pkg_jobs_find_upgrade(j, jp->pattern, jp->match);
@@ -1030,7 +1030,7 @@ pkg_jobs_find_remote_pattern(struct pkg_jobs *j, struct job_pattern *jp)
					pkg_emit_error("%s is not installed, therefore upgrade is impossible",
							jfp.pattern);
					pkg_manifest_keys_free(keys);
-
					return (EPKG_FATAL);
+
					return (EPKG_NOTINSTALLED);
				}
			}
			pkg->type = PKG_FILE;