Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Check required shared libraries.
Vsevolod Stakhov committed 12 years ago
commit 892362b291c6f509c6d6baee9d4e2762e628f9b0
parent d368d5a
2 files changed +37 -0
modified libpkg/pkg_jobs.c
@@ -578,6 +578,8 @@ pkg_jobs_add_universe(struct pkg_jobs *j, struct pkg *pkg,
	struct pkg *npkg, *rpkg;
	int ret;
	struct pkg_job_universe_item *unit;
+
	struct pkg_shlib *shlib = NULL;
+
	struct pkgdb_it *it;

	if (!deps_only) {
		/* Add the requested package itself */
@@ -685,6 +687,22 @@ pkg_jobs_add_universe(struct pkg_jobs *j, struct pkg *pkg,
			return (EPKG_FATAL);
	}

+
	/* For remote packages we should also handle shlib deps */
+
	if (pkg->type != PKG_INSTALLED) {
+
		while (pkg_shlibs_required(pkg, &shlib) == EPKG_OK) {
+
			it = pkgdb_find_shlib_provide(j->db, pkg_shlib_name(shlib), j->reponame);
+
			if (it != NULL) {
+
				npkg = NULL;
+
				while (pkgdb_it_next(it, &npkg, PKG_LOAD_BASIC) == EPKG_OK) {
+
					if (pkg_jobs_add_universe(j, npkg, recursive, false, NULL) != EPKG_OK)
+
						return (EPKG_FATAL);
+
					npkg = NULL;
+
				}
+
				pkgdb_it_free(it);
+
			}
+
		}
+
	}
+

	return (EPKG_OK);
}

modified libpkg/private/pkgdb.h
@@ -181,4 +181,23 @@ const char * pkgdb_get_pattern_query(const char *pattern, match_t match);
 */
bool pkgdb_is_attached(sqlite3 *s, const char *name);

+
/**
+
 * Find provides for a specified require in repos
+
 * @param db
+
 * @param provide
+
 * @param repo
+
 * @return
+
 */
+
struct pkgdb_it *pkgdb_find_shlib_require(struct pkgdb *db,
+
		const char *provide, const char *repo);
+
/**
+
 * Find requires for a specified provide in repos
+
 * @param db
+
 * @param require
+
 * @param repo
+
 * @return
+
 */
+
struct pkgdb_it *pkgdb_find_shlib_provide(struct pkgdb *db,
+
		const char *require, const char *repo);
+

#endif