Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix installed flag in cudf exporter.
Vsevolod Stakhov committed 12 years ago
commit c7f209181fb35e63423be3e6d1889402a726c8ea
parent 5ea88e0
3 files changed +6 -6
modified libpkg/pkg.h.in
@@ -1158,7 +1158,7 @@ int pkg_jobs_apply(struct pkg_jobs *jobs);
 * Emit CUDF spec to a file for a specified jobs request
 * @return error code
 */
-
int pkg_jobs_cudf_emit_file(struct pkg_jobs *, pkg_jobs_t , FILE *, struct pkgdb *);
+
int pkg_jobs_cudf_emit_file(struct pkg_jobs *, pkg_jobs_t , FILE *);

/**
 * Parse the output of an external CUDF solver
modified libpkg/pkg_cudf.c
@@ -92,7 +92,7 @@ cudf_print_element(FILE *f, const char *line, bool has_next, int *column)
}

static int
-
cudf_emit_pkg(struct pkg *pkg, int version, FILE *f, struct pkgdb *db)
+
cudf_emit_pkg(struct pkg *pkg, int version, FILE *f)
{
	const char *origin;
	struct pkg_dep *dep, *dtmp;
@@ -145,7 +145,7 @@ cudf_emit_pkg(struct pkg *pkg, int version, FILE *f, struct pkgdb *db)
		}
	}

-
	if (fprintf(f, "installed: %s\n\n", pkg_is_installed(db, origin) ?
+
	if (fprintf(f, "installed: %s\n\n", pkg->type == PKG_INSTALLED ?
			"true" : "false") < 0)
		return (EPKG_FATAL);

@@ -211,7 +211,7 @@ pkg_cudf_version_cmp(struct pkg_job_universe_item *a, struct pkg_job_universe_it
}

int
-
pkg_jobs_cudf_emit_file(struct pkg_jobs *j, pkg_jobs_t t, FILE *f, struct pkgdb *db)
+
pkg_jobs_cudf_emit_file(struct pkg_jobs *j, pkg_jobs_t t, FILE *f)
{
	struct pkg *pkg;
	struct pkg_job_universe_item *it, *itmp, *icur;
@@ -225,7 +225,7 @@ pkg_jobs_cudf_emit_file(struct pkg_jobs *j, pkg_jobs_t t, FILE *f, struct pkgdb
		version = 1;
		LL_FOREACH(it, icur) {
			pkg = icur->pkg;
-
			if (cudf_emit_pkg(pkg, version++, f, db) != EPKG_OK)
+
			if (cudf_emit_pkg(pkg, version++, f) != EPKG_OK)
				return (EPKG_FATAL);
		}
	}
modified libpkg/pkg_jobs.c
@@ -979,7 +979,7 @@ pkg_jobs_solve(struct pkg_jobs *j)
				&& solver != NULL) {
			/* XXX: whether can we use r+ on all supported platforms ? */
			spipe = popen(solver, "r+");
-
			ret = pkg_jobs_cudf_emit_file(j, j->type, spipe, j->db);
+
			ret = pkg_jobs_cudf_emit_file(j, j->type, spipe);
			if (ret == EPKG_OK) {
				ret = pkg_jobs_cudf_parse_output(j, spipe);
			}