diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-07-31 10:02:30 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-31 10:02:30 -0400 | 
| commit | d3a1a8a15a92bfbf16d99529ab1ef7d34b48f37f (patch) | |
| tree | b7cb2d28ae082330379cd747bdc690b9e0698934 /src | |
| parent | 15eef8db2c06f536edee84fe524f5d8fcefd0a5f (diff) | |
| download | stasis-d3a1a8a15a92bfbf16d99529ab1ef7d34b48f37f.tar.gz | |
Fixes readout of packages in delivery (#16)
* 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.
* Read the main and deferred lists no matter what
* Use new style package definition in test config
Diffstat (limited to 'src')
| -rw-r--r-- | src/delivery.c | 32 | 
1 files changed, 26 insertions, 6 deletions
| diff --git a/src/delivery.c b/src/delivery.c index f9907fc..b1997f6 100644 --- a/src/delivery.c +++ b/src/delivery.c @@ -940,27 +940,47 @@ void delivery_conda_show(struct Delivery *ctx) {      printf("%-20s %-10s\n", "Prefix:", ctx->storage.conda_install_prefix);      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); +    if (strlist_count(ctx->conda.conda_packages) || strlist_count(ctx->conda.conda_packages_defer)) { +        struct StrList *list_conda = strlist_init(); +        if (strlist_count(ctx->conda.conda_packages)) { +            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); +    if (strlist_count(ctx->conda.pip_packages) || strlist_count(ctx->conda.pip_packages_defer)) { +        struct StrList *list_python = strlist_init(); +        if (strlist_count(ctx->conda.pip_packages)) { +            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");      } | 
