summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/conflict.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-02-20 01:41:39 +0100
committerAllan McRae <allan@archlinux.org>2013-02-24 04:11:54 +0100
commit19754b34a36203266c4e02f29178084c77282efd (patch)
treeb08b873b0f1ccc5b5b382a6c55f7925b31968561 /lib/libalpm/conflict.c
parent083ac51816323d69fcf2e271ccd52add3cdd6d22 (diff)
downloadpacman-19754b34a36203266c4e02f29178084c77282efd.tar.gz
pacman-19754b34a36203266c4e02f29178084c77282efd.tar.xz
use resolved_path for filelist_contains
alpm_filelist_contains was being used to search for resolved paths, but searching in the unresolved paths, causing it to miss matches. We always search unresolved paths and search the resolved paths if available because _alpm_filelist_resolve is not public and requires a context handle, so it can't be called from alpm_filelist_contains. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/conflict.c')
-rw-r--r--lib/libalpm/conflict.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index ba642dde..afed8953 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -321,6 +321,7 @@ static int dir_belongsto_pkg(alpm_handle_t *handle, const char *dirpath,
const char *root = handle->root;
/* check directory is actually in package - used for subdirectory checks */
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(pkg));
if(!alpm_filelist_contains(alpm_pkg_get_files(pkg), dirpath)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"directory %s not in package %s\n", dirpath, pkg->name);
@@ -339,6 +340,7 @@ static int dir_belongsto_pkg(alpm_handle_t *handle, const char *dirpath,
continue;
}
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(i->data));
if(alpm_filelist_contains(alpm_pkg_get_files(i->data), dirpath)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"file %s also in package %s\n", dirpath,
@@ -373,6 +375,7 @@ static int dir_belongsto_pkg(alpm_handle_t *handle, const char *dirpath,
return 0;
}
} else {
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(pkg));
if(alpm_filelist_contains(alpm_pkg_get_files(pkg), path)) {
continue;
} else {
@@ -544,6 +547,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_pkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name);
/* localp2->files will be removed (target conflicts are handled by CHECK 1) */
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(localp2));
if(localp2 && alpm_filelist_contains(alpm_pkg_get_files(localp2), filestr)) {
/* skip removal of file, but not add. this will prevent a second
* package from removing the file when it was already installed
@@ -590,6 +594,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *local_pkgs = _alpm_db_get_pkgcache(handle->db_local);
int found = 0;
for(k = local_pkgs; k && !found; k = k->next) {
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(k->data));
if(alpm_filelist_contains(alpm_pkg_get_files(k->data), filestr)) {
found = 1;
}