aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-10-08 09:48:59 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-10-08 09:48:59 -0400
commit74ce6e826895500cb07bd3d82096bfbd8e431f49 (patch)
tree6ec3a4e9adfdd2eec6c8a31d0fd5ceb14ffebb8c
parent770aba76dd0780e53dc3ce972de6712361a29ca3 (diff)
downloadstasis-74ce6e826895500cb07bd3d82096bfbd8e431f49.tar.gz
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.
-rw-r--r--src/delivery_install.c8
1 files changed, 6 insertions, 2 deletions
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;