From 74ce6e826895500cb07bd3d82096bfbd8e431f49 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 8 Oct 2024 09:48:59 -0400 Subject: Fixes bug found in delivery_overlay_packages_from_env(): * When "pip freeze" does not emit any packages we now avoid replacing the context's pip package list with an empty one. --- src/delivery_install.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/delivery_install.c') diff --git a/src/delivery_install.c b/src/delivery_install.c index a7754e8..76c3f4a 100644 --- a/src/delivery_install.c +++ b/src/delivery_install.c @@ -99,8 +99,12 @@ int delivery_overlay_packages_from_env(struct Delivery *ctx, const char *env_nam } } } - guard_strlist_free(&ctx->conda.pip_packages); - ctx->conda.pip_packages = strlist_copy(new_list); + + // Replace the package manifest as needed + if (strlist_count(new_list)) { + guard_strlist_free(&ctx->conda.pip_packages); + ctx->conda.pip_packages = strlist_copy(new_list); + } guard_strlist_free(&new_list); guard_strlist_free(&frozen_list); return 0; -- cgit