From 75fe6ef104b1071bf763354177f3c4339c1c7854 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 15 Sep 2015 01:08:16 -0400 Subject: sortbydeps: skip local packages being updated Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/deps.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') 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); } -- cgit v1.2.3