diff options
author | Nagy Gabor <ngaba@bibl.u-szeged.hu> | 2007-11-18 14:25:43 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-18 12:42:39 -0600 |
commit | 2aa7e69da91c1d7a18473cf05df98c92bd1dc747 (patch) | |
tree | 1bec8c7ecd1fa012522d2bc311ecefb0f45e1d3b /lib/libalpm/conflict.h | |
parent | 65fb99133df10143e07c237f04777e01b443c037 (diff) | |
download | pacman-2aa7e69da91c1d7a18473cf05df98c92bd1dc747.tar.xz |
Add the pmconflict_t type.
pmdepmissing_t was used for two totally different things :
missing dependencies, and dependency conflicts.
So this patch simply adds a type for dep conflicts,
and convert the code to use it.
This fix the TODO in conflict.c :
/* TODO WTF is a 'depmissing' doing indicating a conflict? */
Additionally, the code in conflict.c now eliminates the duplicated conflicts.
If pkg1 conflicts with pkg2, and pkg2 conflicts with pkg1, only one of them will be stored.
However the conflict handling in sync_prepare (sync.c) is still very asymetrical, and very ugly too.
This should be improved in the future (there is already a pending patch from Nagy that cleans it a lot).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm/conflict.h')
-rw-r--r-- | lib/libalpm/conflict.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h index f8aebbf1..89695353 100644 --- a/lib/libalpm/conflict.h +++ b/lib/libalpm/conflict.h @@ -27,6 +27,11 @@ #define CONFLICT_FILE_LEN 512 +struct __pmconflict_t { + char package1[PKG_NAME_LEN]; + char package2[PKG_NAME_LEN]; +}; + struct __pmfileconflict_t { char target[PKG_NAME_LEN]; pmfileconflicttype_t type; @@ -34,6 +39,8 @@ struct __pmfileconflict_t { char ctarget[PKG_NAME_LEN]; }; +pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2); +int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack); 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); |