Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-10-17 23:38:58 -0400
committerAllan McRae <allan@archlinux.org>2013-10-31 16:20:02 +1000
commitc2134fde2be179c490b33765fe5504be96291b95 (patch)
tree52c3e7b6c813591ce1f71b2ad5161e57b142ed71 /lib/libalpm/sync.c
parent2194eddf30bea718c2b5fd6b86d2a626783fc901 (diff)
sortbydeps: include local pkgs in dep graph
Detecting indirect dependencies by traversing a package's entire dependency tree is prohibitively slow for larger transactions. Instead add local packages to the dependency graph. This additionally requires delaying dependency ordering for sync operations so that removed packages may be excluded from dependency detection. tests/sync012.py was also updated to ensure that the dependency cycle was actually detected. Fixes FS#37380 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 066f1f22..551f9269 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -471,10 +471,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
* holds to package objects. */
trans->unresolvable = unresolvable;
- /* re-order w.r.t. dependencies */
alpm_list_free(trans->add);
- trans->add = _alpm_sortbydeps(handle, resolved, 0);
- alpm_list_free(resolved);
+ trans->add = resolved;
EVENT(handle, ALPM_EVENT_RESOLVEDEPS_DONE, NULL, NULL);
}
@@ -628,6 +626,11 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
}
goto cleanup;
}
+
+ /* re-order w.r.t. dependencies */
+ alpm_list_t *add_orig = trans->add;
+ trans->add = _alpm_sortbydeps(handle, add_orig, trans->remove, 0);
+ alpm_list_free(add_orig);
}
for(i = trans->add; i; i = i->next) {
/* update download size field */