Example #1
0
/**
 * pacman_manager_test_dependencies:
 * @manager: A #PacmanManager.
 * @dependencies: A list of strings representing dependencies. See pacman_dependency_to_string().
 *
 * Tests each dependency in @dependencies to determine whether it is satisfied by an installed package.
 *
 * Returns: A list of strings from @dependencies, corresponding to the dependencies which were not satisfied. Free with pacman_list_free().
 */
PacmanList *pacman_manager_test_dependencies (PacmanManager *manager, const PacmanList *dependencies) {
	PacmanDatabase *database;
	
	g_return_val_if_fail (manager != NULL, NULL);
	
	database = pacman_manager_get_local_database (manager);
	g_return_val_if_fail (database != NULL, NULL);
	
	return alpm_deptest (database, (PacmanList *) dependencies);
}
Example #2
0
int pacman_deptest(alpm_list_t *targets)
{
	alpm_list_t *i;

	alpm_list_t *deps = alpm_deptest(alpm_option_get_localdb(), targets);
	if(deps == NULL) {
		return(0);
	}

	for(i = deps; i; i = alpm_list_next(i)) {
		const char *dep;

		dep = alpm_list_getdata(i);
		printf("%s\n", dep);
	}
	alpm_list_free(deps);
	return(127);
}