aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-07-31 01:30:41 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-07-31 01:30:41 -0400
commitf3dac9e97a4538021d9cd2f464470ec132050705 (patch)
treec06b8d293cd6c085c5b46453702e174eedb0e935
parent15eef8db2c06f536edee84fe524f5d8fcefd0a5f (diff)
downloadstasis-f3dac9e97a4538021d9cd2f464470ec132050705.tar.gz
Fixes readout of packages in delivery
* Now that the overview is displayed after deferred packages are filtered out of the main list, filtered packages were no longer displayed * This combines the main list and deferred list for both conda, and pip packages.
-rw-r--r--src/delivery.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/delivery.c b/src/delivery.c
index f9907fc..4264016 100644
--- a/src/delivery.c
+++ b/src/delivery.c
@@ -941,26 +941,42 @@ void delivery_conda_show(struct Delivery *ctx) {
puts("Native Packages:");
if (strlist_count(ctx->conda.conda_packages)) {
- for (size_t i = 0; i < strlist_count(ctx->conda.conda_packages); i++) {
- char *token = strlist_item(ctx->conda.conda_packages, i);
+ struct StrList *list_conda = strlist_init();
+ strlist_append_strlist(list_conda, ctx->conda.conda_packages);
+ if (strlist_count(ctx->conda.conda_packages_defer)) {
+ strlist_append_strlist(list_conda, ctx->conda.conda_packages_defer);
+ }
+ strlist_sort(list_conda, STASIS_SORT_ALPHA);
+
+ for (size_t i = 0; i < strlist_count(list_conda); i++) {
+ char *token = strlist_item(list_conda, i);
if (isempty(token) || isblank(*token) || startswith(token, "-")) {
continue;
}
printf("%21s%s\n", "", token);
}
+ guard_strlist_free(&list_conda);
} else {
printf("%21s%s\n", "", "N/A");
}
puts("Python Packages:");
if (strlist_count(ctx->conda.pip_packages)) {
- for (size_t i = 0; i < strlist_count(ctx->conda.pip_packages); i++) {
- char *token = strlist_item(ctx->conda.pip_packages, i);
+ struct StrList *list_python = strlist_init();
+ strlist_append_strlist(list_python, ctx->conda.pip_packages);
+ if (strlist_count(ctx->conda.pip_packages_defer)) {
+ strlist_append_strlist(list_python, ctx->conda.pip_packages_defer);
+ }
+ strlist_sort(list_python, STASIS_SORT_ALPHA);
+
+ for (size_t i = 0; i < strlist_count(list_python); i++) {
+ char *token = strlist_item(list_python, i);
if (isempty(token) || isblank(*token) || startswith(token, "-")) {
continue;
}
printf("%21s%s\n", "", token);
}
+ guard_strlist_free(&list_python);
} else {
printf("%21s%s\n", "", "N/A");
}