Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
sort in alphabetical order the section for upgrades
Baptiste Daroussin committed 6 years ago
commit 64ecf005af300f7f75385b1e0037c916d9153f3d
parent 371fdee
3 files changed +17 -0
modified libpkg/pkg.h.in
@@ -1719,6 +1719,8 @@ void pkg_cache_full_clean(void);
int pkg_get_cachedirfd(void);
int pkg_get_dbdirfd(void);

+
int pkg_namecmp(struct pkg *, struct pkg *);
+

#ifdef __cplusplus
}
#endif
modified libpkg/utils.c
@@ -811,3 +811,10 @@ mkdirat_p(int fd, const char *path)
	free(walkorig);
	return (true);
}
+

+
int
+
pkg_namecmp(struct pkg *a, struct pkg *b)
+
{
+

+
	return (strcmp(a->name, b->name));
+
}
modified src/utils.c
@@ -916,6 +916,13 @@ static const char* pkg_display_messages[PKG_DISPLAY_MAX + 1] = {
	[PKG_DISPLAY_MAX] = NULL
};

+
static int
+
namecmp(struct pkg_solved_display_item *a, struct pkg_solved_display_item *b)
+
{
+

+
	return (pkg_namecmp(a->new, b->new));
+
}
+

int
print_jobs_summary(struct pkg_jobs *jobs, const char *msg, ...)
{
@@ -956,6 +963,7 @@ print_jobs_summary(struct pkg_jobs *jobs, const char *msg, ...)
				msg = NULL;
			}
			printf("%s:\n", pkg_display_messages[type]);
+
			DL_SORT(disp[type], namecmp);
			DL_FOREACH_SAFE(disp[type], cur, tmp) {
				display_summary_item(cur, dlsize);
				displayed ++;