return resolved paths from filelist_intersection

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@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2013-02-15 19:21:35 -05:00 committed by Allan McRae
parent 4a1d93b92c
commit 9995510dc8
3 changed files with 3 additions and 5 deletions

View File

@ -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);

View File

@ -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++;

View File

@ -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