Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix issue with universe processing.
Vsevolod Stakhov committed 11 years ago
commit f6a46a1fa2fe526b6d77d8495339158c58bca48f
parent 1e3e5b1
3 files changed +21 -11
modified libpkg/pkg_jobs.c
@@ -1296,6 +1296,7 @@ jobs_solve_deinstall(struct pkg_jobs *j)

	j->solved = 1;
	pkg_jobs_process_delete_request(j);
+
	j->universe->processed = true;

	return( EPKG_OK);
}
@@ -1325,6 +1326,7 @@ jobs_solve_autoremove(struct pkg_jobs *j)

	j->solved = true;
	pkg_jobs_process_delete_request(j);
+
	j->universe->processed = true;

	return (EPKG_OK);
}
@@ -1479,6 +1481,7 @@ jobs_solve_install_upgrade(struct pkg_jobs *j)
			HASH_ITER(hh, j->request_add, req, rtmp) {
				pkg_jobs_universe_process(j->universe, req->item->pkg);
			}
+
			j->universe->processed = true;
		}
		else {
			HASH_ITER(hh, j->patterns, jp, jtmp) {
@@ -1491,14 +1494,13 @@ jobs_solve_install_upgrade(struct pkg_jobs *j)
					return (EPKG_FATAL);
				}
			}
-
			if (got_local) {
-
				/*
-
				 * Need to iterate request one more time to recurse depends
-
				 */
-
				HASH_ITER(hh, j->request_add, req, rtmp) {
-
					pkg_jobs_universe_process(j->universe, req->item->pkg);
-
				}
+
			/*
+
			 * Need to iterate request one more time to recurse depends
+
			 */
+
			HASH_ITER(hh, j->request_add, req, rtmp) {
+
				pkg_jobs_universe_process(j->universe, req->item->pkg);
			}
+
			j->universe->processed = true;
		}
	}
	else {
@@ -1982,6 +1984,7 @@ pkg_jobs_apply(struct pkg_jobs *j)
						if (rc == EPKG_CONFLICT) {
							/* Cleanup results */
							LL_FREE(j->jobs, free);
+
							j->universe->processed = false;
							j->jobs = NULL;
							j->count = 0;
							has_conflicts = true;
modified libpkg/pkg_jobs_universe.c
@@ -443,12 +443,18 @@ pkg_jobs_universe_process_item(struct pkg_jobs_universe *universe, struct pkg *p

	job_flags = universe->j->flags;

-
	/* Add pkg itself */
+
	/*
+
	 * Add pkg itself. If package is already seen then we check the `processed`
+
	 * flag that means that we have already tried to check our universe
+
	 */
	rc = pkg_jobs_universe_add_pkg(universe, pkg, false, result);
-
	if (rc == EPKG_END)
-
		return (EPKG_OK);
-
	else if (rc != EPKG_OK)
+
	if (rc == EPKG_END) {
+
		if (universe->processed)
+
			return (EPKG_OK);
+
	}
+
	else if (rc != EPKG_OK) {
		return (rc);
+
	}

	/* Convert jobs flags to dependency logical flags */
	if (job_flags & PKG_FLAG_FORCE_MISSING)
modified libpkg/private/pkg_jobs.h
@@ -92,6 +92,7 @@ struct pkg_jobs_universe {
	struct pkg_job_provide *provides;
	struct pkg_job_replace *uid_replaces;
	struct pkg_jobs *j;
+
	bool processed;
	size_t nitems;
};