summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2010-09-12 12:37:49 -0400
committerJason Woodward2010-09-12 12:37:49 -0400
commitaecbb3ab6d0cc8231a2172d3023ae448574b8390 (patch)
tree92e55a7d0e20d428f7905e3bb56f15d955205bd6 /src
parent648c92de40483300a32529e73a68b15c85b44602 (diff)
downloadslapt-get-aecbb3ab6d0cc8231a2172d3023ae448574b8390.tar.gz
comment on why we have a seemingly needless sort
Diffstat (limited to 'src')
-rw-r--r--src/package.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/package.c b/src/package.c
index 53a5112..f5d3ab1 100644
--- a/src/package.c
+++ b/src/package.c
@@ -64,6 +64,9 @@ struct slapt_pkg_list *slapt_get_available_pkgs(void)
list = slapt_parse_packages_txt(pkg_list_fh);
fclose(pkg_list_fh);
+ /* this is pointless to do if we wrote the data sorted, but this
+ ensures upgrades from older, presorting slapt-gets still work
+ as expected. */
qsort( list->pkgs, list->pkg_count, sizeof(list->pkgs[0]), pkg_compare );
list->ordered = SLAPT_TRUE;