diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-12-19 10:04:35 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-19 10:04:35 -0500 | 
| commit | d117a9724e9335ba738fd5cb99c27d4793a4976d (patch) | |
| tree | 684451f6b834be5b32275cc360b587030bcf02b5 /src/cli | |
| parent | 8186ad89bbd7cfab65700045eaa9b26f8f877bfb (diff) | |
| parent | 54ac1e2e256252ec75fbdfe668a3328fb5d02c31 (diff) | |
| download | stasis-d117a9724e9335ba738fd5cb99c27d4793a4976d.tar.gz | |
Merge pull request #78 from jhunkeler/remove-package-from-delivery
Allow removing packages from a delivery
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/stasis/stasis_main.c | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index dc4e2d1..61f198e 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -390,6 +390,20 @@ int main(int argc, char *argv[]) {      }      if (!isempty(ctx.meta.based_on)) { +        if (ctx.conda.conda_packages_purge && strlist_count(ctx.conda.conda_packages_purge)) { +            msg(STASIS_MSG_L2, "Purging conda packages\n"); +            if (delivery_purge_packages(&ctx, env_name_testing, PKG_USE_CONDA)) { +                msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "unable to purge requested conda packages from %s\n", env_name_testing); +                exit(1); +            } +        } +        if (ctx.conda.pip_packages_purge && strlist_count(ctx.conda.pip_packages_purge)) { +            msg(STASIS_MSG_L2, "Purging pip packages\n"); +            if (delivery_purge_packages(&ctx, env_name_testing, PKG_USE_PIP)) { +                msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "unable to purge requested pip packages from %s\n", env_name_testing); +                exit(1); +            } +        }          msg(STASIS_MSG_L1, "Generating package overlay from environment: %s\n", env_name);          if (delivery_overlay_packages_from_env(&ctx, env_name)) {              msg(STASIS_MSG_L2 | STASIS_MSG_ERROR, "%s", "Failed to generate package overlay. Resulting environment integrity cannot be guaranteed.\n"); @@ -462,6 +476,22 @@ int main(int argc, char *argv[]) {          msg(STASIS_MSG_L3, "No deferred conda packages\n");      } +    if (ctx.conda.conda_packages_purge && strlist_count(ctx.conda.conda_packages_purge)) { +        msg(STASIS_MSG_L2, "Purging conda packages\n"); +        if (delivery_purge_packages(&ctx, env_name, PKG_USE_CONDA)) { +            msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "unable to purge requested conda packages\n"); +            exit(1); +        } +    } + +    if (ctx.conda.pip_packages_purge && strlist_count(ctx.conda.pip_packages_purge)) { +        msg(STASIS_MSG_L2, "Purging pip packages\n"); +        if (delivery_purge_packages(&ctx, env_name, PKG_USE_PIP)) { +            msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "unable to purge requested pip packages"); +            exit(1); +        } +    } +      msg(STASIS_MSG_L2, "Installing pip packages\n");      if (strlist_count(ctx.conda.pip_packages)) {          if (delivery_install_packages(&ctx, ctx.storage.conda_install_prefix, env_name, INSTALL_PKG_PIP, (struct StrList *[]) {ctx.conda.pip_packages, NULL})) {  | 
