diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-06 10:06:29 -0500 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-06 10:06:29 -0500 | 
| commit | 2823057fbbf7dc9d30f66910a950a32ea31ad897 (patch) | |
| tree | 70a8f917654f46de34b331aa8b64afa60e1b5308 | |
| parent | 0045b844eb7b85f0de8630d17ff6d7e5f82b14ca (diff) | |
| download | stasis-2823057fbbf7dc9d30f66910a950a32ea31ad897.tar.gz | |
Fix error when no conda/pip packages are present in a delivery.
* This prevents issuing no arguments to conda install leading to program exit
| -rw-r--r-- | src/main.c | 11 | 
1 files changed, 8 insertions, 3 deletions
| @@ -426,8 +426,10 @@ int main(int argc, char *argv[], char *arge[]) {      // Populate the release environment      msg(OMC_MSG_L1, "Populating release environment\n");      msg(OMC_MSG_L2, "Installing conda packages\n"); -    if (delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_CONDA, (struct StrList *[]) {ctx.conda.conda_packages, NULL})) { -        exit(1); +    if (strlist_count(ctx.conda.conda_packages)) { +        if (delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_CONDA, (struct StrList *[]) {ctx.conda.conda_packages, NULL})) { +            exit(1); +        }      }      if (strlist_count(ctx.conda.conda_packages_defer)) {          msg(OMC_MSG_L3, "Installing deferred conda packages\n"); @@ -439,7 +441,10 @@ int main(int argc, char *argv[], char *arge[]) {      }      msg(OMC_MSG_L2, "Installing pip packages\n"); -    delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_PIP, (struct StrList *[]) {ctx.conda.pip_packages, NULL}); +    if (strlist_count(ctx.conda.pip_packages)) { +        delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_PIP, (struct StrList *[]) {ctx.conda.pip_packages, NULL}); +    } +      msg(OMC_MSG_L3, "Installing deferred pip packages\n");      delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_PIP | INSTALL_PKG_PIP_DEFERRED, (struct StrList *[]) {ctx.conda.pip_packages_defer, NULL}); | 
