Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-02-13 18:54:33 -0500
committerAllan McRae <allan@archlinux.org>2013-02-16 11:06:43 +1000
commitc1a84c03b2c8762970af2270160ea3279ff9a525 (patch)
tree0633746e16a9e88ac5d2f77e99ea73d7f3941625
parent0a5b79e1339ce07c06b86f2d8cdc474f3532919d (diff)
find_fileconflicts: reduce path resolution calls
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/conflict.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 610e5ad2..96f2109b 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -414,6 +414,11 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
rootlen = strlen(handle->root);
+ /* make sure all files to be installed have been resolved */
+ for(i = upgrade; i; i = i->next) {
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(i->data));
+ }
+
/* TODO this whole function needs a huge change, which hopefully will
* be possible with real transactions. Right now we only do half as much
* here as we do when we actually extract files in add.c with our 12
@@ -429,15 +434,12 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
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));
@@ -463,7 +465,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
_alpm_log(handle, ALPM_LOG_DEBUG, "searching for filesystem conflicts: %s\n",
p1->name);
dbpkg = _alpm_db_get_pkgfromcache(handle->db_local, p1->name);
- _alpm_filelist_resolve(handle, alpm_pkg_get_files(dbpkg));
/* Do two different checks here. If the package is currently installed,
* then only check files that are new in the new package. If the package
@@ -471,6 +472,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
* that the former list needs to be freed while the latter list should NOT
* be freed. */
if(dbpkg) {
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(dbpkg));
alpm_list_t *difference;
/* older ver of package currently installed */
difference = _alpm_filelist_difference(alpm_pkg_get_files(p1),