From eae6bf8ab493cc1a4f801df43199778ddc2abb53 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 20 Oct 2011 13:10:39 +0200 Subject: [PATCH] libxbps: when sorting deps, add removed pkgs to head. --- lib/transaction_sortdeps.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/transaction_sortdeps.c b/lib/transaction_sortdeps.c index b0c81940..f9482d54 100644 --- a/lib/transaction_sortdeps.c +++ b/lib/transaction_sortdeps.c @@ -372,16 +372,23 @@ xbps_sort_pkg_deps(void) rv = ENOMEM; goto out; } - TAILQ_INSERT_TAIL(&pkgdep_list, pd, pkgdep_entries); + if (strcmp(pd->trans, "remove") == 0) { + xbps_dbg_printf_append("added into head."); + TAILQ_INSERT_HEAD(&pkgdep_list, pd, + pkgdep_entries); + } else { + xbps_dbg_printf_append("added into tail."); + TAILQ_INSERT_TAIL(&pkgdep_list, pd, + pkgdep_entries); + } } /* - * Packages that don't have deps go unsorted, because + * Packages that don't have deps go at head, because * it doesn't matter. */ rundeps = prop_dictionary_get(obj, "run_depends"); if (rundeps == NULL || prop_array_count(rundeps) == 0) { - xbps_dbg_printf_append("added (no rundeps) into " - "the sorted queue.\n"); + xbps_dbg_printf_append("\n"); cnt++; continue; }