diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-07-20 11:56:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-20 11:56:16 -0400 |
commit | 9489d31f6314322d26ec43196284b94069d6cd3a (patch) | |
tree | 3c314ff91b187faa2ba0f9ca2faf866d4fb97610 /src/delivery.c | |
parent | 07dc44efdc5c2fbc2b34c969e623d3b0bc0df15a (diff) | |
download | stasis-9489d31f6314322d26ec43196284b94069d6cd3a.tar.gz |
Regression tests, envctl, and bug fixes (#13)
* Found too many bugs
* Implements a regression test
* Moves and completely refactors the envctl code
* Allows the user to keep @STR@ values in output files (if you want full control over where external packages comes from post-build)
* Fixes wording in a few places
* envctl redaction is not implemented yet. The original redaction code hasn't been modified.
* Use generic.ini instead of bare_minimum.ini
Diffstat (limited to 'src/delivery.c')
-rw-r--r-- | src/delivery.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/delivery.c b/src/delivery.c index b27ab08..d7b9b99 100644 --- a/src/delivery.c +++ b/src/delivery.c @@ -1676,7 +1676,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) } remove(tempfile); guard_free(tempfile); - } else if (stage == DELIVERY_REWRITE_SPEC_STAGE_2) { + } else if (globals.enable_rewrite_spec_stage_2 && stage == DELIVERY_REWRITE_SPEC_STAGE_2) { // Replace "local" channel with the staging URL if (ctx->storage.conda_staging_url) { file_replace_text(filename, "@CONDA_CHANNEL@", ctx->storage.conda_staging_url, 0); @@ -1684,15 +1684,19 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) sprintf(output, "%s/%s/%s/%s/packages/conda", globals.jfrog.url, globals.jfrog.repo, ctx->meta.mission, ctx->info.build_name); file_replace_text(filename, "@CONDA_CHANNEL@", output, 0); } else { - msg(STASIS_MSG_WARN, "conda_staging_url is not configured\n", filename); - file_replace_text(filename, " - @CONDA_CHANNEL@", "", 0); + msg(STASIS_MSG_WARN, "conda_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.conda_artifact_dir); + file_replace_text(filename, "@CONDA_CHANNEL@", ctx->storage.conda_artifact_dir, 0); } if (ctx->storage.wheel_staging_url) { file_replace_text(filename, "@PIP_ARGUMENTS@", ctx->storage.wheel_staging_url, 0); - } else if (globals.jfrog.repo) { + } else if (globals.jfrog.url && globals.jfrog.repo) { sprintf(output, "--extra-index-url %s/%s/%s/%s/packages/wheels", globals.jfrog.url, globals.jfrog.repo, ctx->meta.mission, ctx->info.build_name); file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); + } else { + msg(STASIS_MSG_WARN, "wheel_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.wheel_artifact_dir); + sprintf(output, "--extra-index-url file://%s", ctx->storage.wheel_artifact_dir); + file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); } } } |