diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-05-11 15:47:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-11 15:47:09 -0400 |
| commit | 4649a889a916aa377ebd3ca8f3daa9ac703baa34 (patch) | |
| tree | 993173328bdf96eb469c2412241f202cdbc5cf53 /src/lib/delivery/delivery_postprocess.c | |
| parent | 58d3ca17dcd3f8b3aeb50b8e4f24afc76d33ff26 (diff) | |
| parent | b7a60c5bed989a52a53b8b697203f55367f55a89 (diff) | |
| download | stasis-4649a889a916aa377ebd3ca8f3daa9ac703baa34.tar.gz | |
Merge pull request #143 from jhunkeler/use-sys-macros
Replace msg, perror, and fprintf with SYS message macros
Diffstat (limited to 'src/lib/delivery/delivery_postprocess.c')
| -rw-r--r-- | src/lib/delivery/delivery_postprocess.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/delivery/delivery_postprocess.c b/src/lib/delivery/delivery_postprocess.c index 0f7d948..63093b3 100644 --- a/src/lib/delivery/delivery_postprocess.c +++ b/src/lib/delivery/delivery_postprocess.c @@ -78,12 +78,12 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) header = delivery_get_release_header(ctx); SYSDEBUG("Release header:\n%s", header); if (!header) { - msg(STASIS_MSG_ERROR, "failed to generate release header string\n", filename); + SYSERROR("failed to generate release header string", filename); exit(1); } tempfile = xmkstemp(&tp, "w+"); if (!tempfile || !tp) { - msg(STASIS_MSG_ERROR, "%s: unable to create temporary file\n", strerror(errno)); + SYSERROR("%s: unable to create temporary file", strerror(errno)); exit(1); } SYSDEBUG("Writing header to temporary file: %s", tempfile); @@ -92,7 +92,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) // Read the original file char **contents = file_readlines(filename, 0, 0, NULL); if (!contents) { - msg(STASIS_MSG_ERROR, "%s: unable to read %s", filename); + SYSERROR("%s: unable to read %s", filename); exit(1); } @@ -136,7 +136,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) // Replace the original file with our temporary data if (copy2(tempfile, filename, CT_PERM) < 0) { - fprintf(stderr, "%s: could not rename '%s' to '%s'\n", strerror(errno), tempfile, filename); + SYSERROR("%s: could not rename '%s' to '%s'", strerror(errno), tempfile, filename); exit(1); } SYSDEBUG("Removing file: %s", tempfile); @@ -155,7 +155,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) file_replace_text(filename, "@CONDA_CHANNEL@", output, 0); } else { SYSDEBUG("Will replace conda channel with local conda artifact directory"); - msg(STASIS_MSG_WARN, "conda_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.conda_artifact_dir); + SYSWARN("conda_staging_dir is not configured. Using fallback: '%s'", ctx->storage.conda_artifact_dir); file_replace_text(filename, "@CONDA_CHANNEL@", ctx->storage.conda_artifact_dir, 0); } @@ -169,7 +169,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); } else { SYSDEBUG("Will replace pip arguments with local wheel artifact directory"); - msg(STASIS_MSG_WARN, "wheel_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.wheel_artifact_dir); + SYSWARN("wheel_staging_dir is not configured. Using fallback: '%s'", ctx->storage.wheel_artifact_dir); snprintf(output, sizeof(output), "--extra-index-url file://%s", ctx->storage.wheel_artifact_dir); file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); } @@ -189,8 +189,7 @@ int delivery_copy_conda_artifacts(struct Delivery *ctx) { // One must run conda build at least once to create the "conda-bld" directory. // When this directory is missing there can be no build artifacts. if (access(conda_build_dir, F_OK) < 0) { - msg(STASIS_MSG_RESTRICT | STASIS_MSG_WARN | STASIS_MSG_L3, - "Skipped: 'conda build' has never been executed.\n"); + SYSWARN("Skipped: 'conda build' has never been executed."); return 0; } |
