Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Reorder request for deletion of packages.
Vsevolod Stakhov committed 12 years ago
commit ac95cade7c27823b3dff86af9a2fac4193370314
parent 21db552
1 file changed +15 -0
modified libpkg/pkg_jobs.c
@@ -890,6 +890,8 @@ jobs_solve_deinstall(struct pkg_jobs *j)
	struct pkg *pkg = NULL;
	struct pkgdb_it *it;
	char *origin;
+
	struct pkg_job_request *req, *rtmp;
+
	struct pkg_job_universe_item *unit;
	bool recursive = false;

	if ((j->flags & PKG_FLAG_RECURSIVE) == PKG_FLAG_RECURSIVE)
@@ -915,6 +917,19 @@ jobs_solve_deinstall(struct pkg_jobs *j)
		}
		pkgdb_it_free(it);
	}
+
	/* XXX:
+
	 * We update priorities in the universe according to the real
+
	 * dependencies graph, however, priorities in the request are not
+
	 * updated. So we cycle through the request and set the priorities
+
	 * equal to priorities in the universe.
+
	 */
+
	HASH_ITER(hh, j->request_delete, req, rtmp) {
+
		pkg_get(req->pkg, PKG_ORIGIN, &origin);
+
		HASH_FIND_STR(j->universe, origin, unit);
+
		if (unit != NULL) {
+
			req->priority = unit->priority;
+
		}
+
	}

	j->solved = true;