Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-09-15 01:08:16 -0400
committerAllan McRae <allan@archlinux.org>2015-09-19 15:12:35 +1000
commit75fe6ef104b1071bf763354177f3c4339c1c7854 (patch)
tree2d09b785e0e2b471e9e0d598e5b46a5774a83034 /lib/libalpm/deps.c
parent486643083c853a1d541d6f8e93c68b7a542f5a2d (diff)
sortbydeps: skip local packages being updated
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index daab9c3f..34ac8d39 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -105,7 +105,13 @@ static alpm_list_t *dep_graph_init(alpm_handle_t *handle,
alpm_list_t *i, *j;
alpm_list_t *vertices = NULL;
alpm_list_t *localpkgs = alpm_list_diff(
- alpm_db_get_pkgcache(handle->db_local), ignore, _alpm_pkg_cmp);
+ alpm_db_get_pkgcache(handle->db_local), targets, _alpm_pkg_cmp);
+
+ if(ignore) {
+ alpm_list_t *oldlocal = localpkgs;
+ localpkgs = alpm_list_diff(oldlocal, ignore, _alpm_pkg_cmp);
+ alpm_list_free(oldlocal);
+ }
/* We create the vertices */
for(i = targets; i; i = i->next) {
@@ -137,8 +143,7 @@ static alpm_list_t *dep_graph_init(alpm_handle_t *handle,
alpm_graph_t *vertex_j = _alpm_graph_new();
vertex_j->data = (void *)j->data;
vertices = alpm_list_add(vertices, vertex_j);
- vertex_i->children =
- alpm_list_add(vertex_i->children, vertex_j);
+ vertex_i->children = alpm_list_add(vertex_i->children, vertex_j);
localpkgs = alpm_list_remove_item(localpkgs, j);
free(j);
}