1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Add new public alpm_checkdbconflicts function.

This function has a limited purpose, but might be interesting to do a
sanity check from a frontend (eg testdb).

Also removed the private _alpm_checkconflicts function to avoid confusion.
This function was used only once in libalpm, in sync.c, and was just a
single line anyway. Having to do it manually makes it explicit that we are
looking for two kind of conflicts (targ vs targ and db vs targ).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2007-12-09 14:49:34 +01:00 committed by Dan McGee
parent 6b8f404a33
commit 22c900e7d5
4 changed files with 11 additions and 5 deletions

View File

@ -386,6 +386,8 @@ alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets);
const char *alpm_miss_get_target(const pmdepmissing_t *miss);
pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss);
alpm_list_t *alpm_checkdbconflicts(pmdb_t *db_local);
const char *alpm_conflict_get_package1(pmconflict_t *conflict);
const char *alpm_conflict_get_package2(pmconflict_t *conflict);

View File

@ -207,9 +207,13 @@ alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages)
return(baddeps);
}
/* Check for transaction conflicts */
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages) {
return(alpm_list_join(_alpm_innerconflicts(packages), _alpm_outerconflicts(db, packages)));
/** Check the package conflicts in a database
*
* @param db_local the database to check
* @return an alpm_list_t of pmconflict_t
*/
alpm_list_t SYMEXPORT *alpm_checkdbconflicts(pmdb_t *db_local) {
return(_alpm_innerconflicts(_alpm_db_get_pkgcache(db_local)));
}
/* Returns a alpm_list_t* of file conflicts.

View File

@ -40,7 +40,6 @@ void _alpm_conflict_free(pmconflict_t *conflict);
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages);
alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root);
void _alpm_fileconflict_free(pmfileconflict_t *conflict);

View File

@ -456,7 +456,8 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
_alpm_log(PM_LOG_DEBUG, "looking for conflicts\n");
deps = _alpm_checkconflicts(db_local, list);
deps = alpm_list_join(_alpm_innerconflicts(list),
_alpm_outerconflicts(db_local, list));
if(deps) {
int errorout = 0;
alpm_list_t *asked = NULL;