summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-07-20 14:25:18 +0200
committerAllan McRae <allan@archlinux.org>2012-12-14 03:35:34 +0100
commit88e7ea421ebbef86daa20ee0f9aff768a445b467 (patch)
treed81396c992d4282273e6243dc6d33fe835f10458 /lib
parent28d404f16aca8ae1b7640b32c221c8b8860f8ce0 (diff)
downloadpacman-88e7ea421ebbef86daa20ee0f9aff768a445b467.tar.gz
pacman-88e7ea421ebbef86daa20ee0f9aff768a445b467.tar.xz
Resolve file paths during inter-package conflict check
File paths are resolved if necessary during inter-package conflict checks so that packages carrying the same effective file due to directory symlinks on the filesystem are flagged as conflicting. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/conflict.c5
-rw-r--r--lib/libalpm/filelist.c13
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index ccfe990c..afef56cb 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -361,12 +361,17 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
int percent = (current * 100) / numtargs;
PROGRESS(handle, ALPM_PROGRESS_CONFLICTS_START, "", percent,
numtargs, current);
+
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(p1));
+
/* CHECK 1: check every target against every target */
_alpm_log(handle, ALPM_LOG_DEBUG, "searching for file conflicts: %s\n",
p1->name);
for(j = i->next; j; j = j->next) {
alpm_list_t *common_files;
alpm_pkg_t *p2 = j->data;
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(p2));
+
common_files = _alpm_filelist_intersection(alpm_pkg_get_files(p1),
alpm_pkg_get_files(p2));
diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c
index a3f63970..233cfda4 100644
--- a/lib/libalpm/filelist.c
+++ b/lib/libalpm/filelist.c
@@ -268,21 +268,18 @@ alpm_list_t *_alpm_filelist_intersection(alpm_filelist_t *filesA,
int cmp, isdirA, isdirB;
char *strA, *strB;
- alpm_file_t *fileA = filesA->files + ctrA;
- alpm_file_t *fileB = filesB->files + ctrB;
-
isdirA = 0;
- strA = fileA->name;
+ strA = filesA->resolved_path[ctrA];
if(strA[strlen(strA)-1] == '/') {
isdirA = 1;
- strA = strndup(fileA->name, strlen(strA)-1);
+ strA = strndup(filesA->resolved_path[ctrA], strlen(strA)-1);
}
isdirB = 0;
- strB = fileB->name;
+ strB = filesB->resolved_path[ctrB];
if(strB[strlen(strB)-1] == '/') {
isdirB = 1;
- strB = strndup(fileB->name, strlen(strB)-1);
+ strB = strndup(filesB->resolved_path[ctrB], strlen(strB)-1);
}
cmp = strcmp(strA, strB);
@@ -300,7 +297,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, fileA);
+ ret = alpm_list_add(ret, filesA->files + ctrA);
}
ctrA++;
ctrB++;