aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-10 11:02:58 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-10 11:02:58 -0400
commit2f84e24a69fa8d83a73fad9280dbf8a5635e4768 (patch)
tree441d5b9558a9fe96ddcf8a6e75f2cc65f42d41b8
parent66636245e4457fd0458539c8468f3da5e0afe095 (diff)
downloadstasis-2f84e24a69fa8d83a73fad9280dbf8a5635e4768.tar.gz
Fix docker build error
* Inject template string into spec only when the delivery requires it. Otherwise, conda's JSON files, or the pypi index will be missing, or invalid.
-rw-r--r--src/deliverable.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/deliverable.c b/src/deliverable.c
index ceeb679..e00c3f7 100644
--- a/src/deliverable.c
+++ b/src/deliverable.c
@@ -1413,12 +1413,16 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage)
for (size_t i = 0; contents[i] != NULL; i++) {
if (startswith(contents[i], "channels:")) {
// Allow for additional conda channel injection
- fprintf(tp, "%s - @CONDA_CHANNEL@\n", contents[i]);
- continue;
+ if (ctx->conda.conda_packages_defer && strlist_count(ctx->conda.conda_packages_defer)) {
+ fprintf(tp, "%s - @CONDA_CHANNEL@\n", contents[i]);
+ continue;
+ }
} else if (strstr(contents[i], "- pip:")) {
- // Allow for additional pip argument injection
- fprintf(tp, "%s - @PIP_ARGUMENTS@\n", contents[i]);
- continue;
+ if (ctx->conda.pip_packages_defer && strlist_count(ctx->conda.pip_packages_defer)) {
+ // Allow for additional pip argument injection
+ fprintf(tp, "%s - @PIP_ARGUMENTS@\n", contents[i]);
+ continue;
+ }
} else if (startswith(contents[i], "prefix:")) {
// Remove the prefix key
if (strstr(contents[i], "/") || strstr(contents[i], "\\")) {