[pacman-dev] [PATCH 3/5] return resolved paths from filelist_intersection
Andrew Gregory
andrew.gregory.8 at gmail.com
Fri Feb 15 21:02:17 EST 2013
We were comparing files based on resolved paths but returning the
original file_t structures, which were not necessarily in the same
order. The additional file_t information was never used, so just return
the resolved path.
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
lib/libalpm/conflict.c | 4 ++--
lib/libalpm/filelist.c | 2 +-
test/pacman/tests/fileconflict022.py | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 1aa653f..54e79fe 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -448,8 +448,8 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *k;
char path[PATH_MAX];
for(k = common_files; k; k = k->next) {
- alpm_file_t *file = k->data;
- snprintf(path, PATH_MAX, "%s%s", handle->root, file->name);
+ char *filename = k->data;
+ snprintf(path, PATH_MAX, "%s%s", handle->root, filename);
conflicts = add_fileconflict(handle, conflicts, path, p1, p2);
if(handle->pm_errno == ALPM_ERR_MEMORY) {
FREELIST(conflicts);
diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c
index c4814a4..5c5f017 100644
--- a/lib/libalpm/filelist.c
+++ b/lib/libalpm/filelist.c
@@ -299,7 +299,7 @@ alpm_list_t *_alpm_filelist_intersection(alpm_filelist_t *filesA,
/* when not directories, item in both qualifies as an intersect */
if(! (isdirA && isdirB)) {
- ret = alpm_list_add(ret, filesA->files + ctrA);
+ ret = alpm_list_add(ret, filesA->resolved_path[ctrA]);
}
ctrA++;
ctrB++;
diff --git a/test/pacman/tests/fileconflict022.py b/test/pacman/tests/fileconflict022.py
index 6f9aec9..5759d4c 100644
--- a/test/pacman/tests/fileconflict022.py
+++ b/test/pacman/tests/fileconflict022.py
@@ -17,5 +17,3 @@
self.addrule("PACMAN_OUTPUT=.*/usr/lib/file exists in both 'foo' and 'bar'")
self.addrule("!PKG_EXIST=foo")
self.addrule("!PKG_EXIST=bar")
-
-self.expectfailure = True
--
1.8.1.3
More information about the pacman-dev
mailing list