diff options
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})) {  | 
