Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Improve error reporting.
Vsevolod Stakhov committed 12 years ago
commit d039ef6f222e78bd2ad3547e86f6e469433c3ecf
parent d195476
2 files changed +7 -3
modified libpkg/pkg_jobs.c
@@ -194,12 +194,13 @@ static int
pkg_jobs_handle_pkg_universe(struct pkg_jobs *j, struct pkg *pkg)
{
	struct pkg_job_universe_item *item, *cur, *tmp = NULL;
-
	const char *origin, *digest, *digest_cur;
+
	const char *origin, *digest, *digest_cur, *version, *name;
	char *new_digest;
	int rc;
	struct sbuf *sb;

-
	pkg_get(pkg, PKG_ORIGIN, &origin, PKG_DIGEST, &digest);
+
	pkg_get(pkg, PKG_ORIGIN, &origin, PKG_DIGEST, &digest,
+
			PKG_VERSION, &version, PKG_NAME, &name);
	if (digest == NULL) {
		/* We need to calculate digest of this package */
		sb = sbuf_new_auto();
@@ -244,6 +245,7 @@ pkg_jobs_handle_pkg_universe(struct pkg_jobs *j, struct pkg *pkg)
		return (EPKG_FATAL);
	}

+
	pkg_debug(2, "universe: add new pkg: %s, (%s-%s)", origin, name, version);
	item->pkg = pkg;
	if (tmp != NULL)
		tmp->next = item;
modified libpkg/pkg_solve.c
@@ -355,8 +355,10 @@ pkg_solve_add_universe_variable(struct pkg_jobs *j,

	HASH_FIND_STR(j->universe, __DECONST(char *, origin), unit);
	/* If there is no package in universe, refuse continue */
-
	if (unit == NULL)
+
	if (unit == NULL) {
+
		pkg_emit_error("package %s is not found in universe", origin);
		return (EPKG_FATAL);
+
	}
	/* Need to add a variable */
	nvar = pkg_solve_variable_new(unit->pkg);
	if (nvar == NULL)