Index: pkg.c =================================================================== --- pkg.c.orig 2007-05-29 03:04:45.000000000 +0000 +++ pkg.c 2007-05-29 04:31:14.000000000 +0000 @@ -671,29 +673,38 @@ 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); + /* 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_concat(tmp2,expanded); + spew_package_list ("sorted",tmp2); + 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) {