Index: pkg.c =================================================================== --- pkg.c.orig 2006-08-16 19:01:04.000000000 +0000 +++ pkg.c 2007-04-13 17:33:07.169301000 +0000 @@ -671,29 +671,47 @@ GSList **listp, gboolean in_path_order, gboolean include_private) { GSList *tmp; + GSList * tmp2; GSList *expanded; - expanded = NULL; tmp = packages; + tmp2 = NULL; while (tmp != NULL) { expanded = g_slist_append (expanded, tmp->data); recursive_fill_list (tmp->data, include_private ? get_requires_private : get_requires, &expanded); + if (in_path_order) + { + spew_package_list("original",expanded); + + expanded = packages_sort_by_path_position (expanded); + + spew_package_list ("sorted", expanded); + + /* In the case that we want things sorted by path, we also + * want them sorted by order that they appear on the command + * line, so we sort each package, one by one, and then cat + * them all together at the end. */ + + tmp2 = g_slist_append(tmp2,expanded->data); + + recursive_fill_list (expanded->data, + include_private ? get_requires_private : get_requires, + &tmp2); + g_slist_free (expanded); + + expanded = NULL; + } tmp = tmp->next; - } + } if (in_path_order) { - spew_package_list ("original", expanded); - - expanded = packages_sort_by_path_position (expanded); - - spew_package_list ("sorted", expanded); + expanded = tmp2; } - tmp = expanded; while (tmp != NULL) {