diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-10-31 15:43:58 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-10-31 15:43:58 -0400 |
commit | bfe43a74bd2c5c9cbd6b5f44217a84d6e4a420ba (patch) | |
tree | 13b5a6d364fdf876587ee8634681085d60f8a416 | |
parent | b375160bbb2aec62bb4a1f5352b1aaa52a26741f (diff) | |
download | stasis-bfe43a74bd2c5c9cbd6b5f44217a84d6e4a420ba.tar.gz |
Add delivery get_spec_header()
-rw-r--r-- | include/deliverable.h | 1 | ||||
-rw-r--r-- | src/deliverable.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/deliverable.h b/include/deliverable.h index 08b3565..941f6ba 100644 --- a/include/deliverable.h +++ b/include/deliverable.h @@ -117,6 +117,7 @@ void delivery_tests_show(struct Delivery *ctx); int delivery_build_recipes(struct Delivery *ctx); struct StrList *delivery_build_wheels(struct Delivery *ctx); int delivery_index_wheel_artifacts(struct Delivery *ctx); +char *delivery_get_spec_header(struct Delivery *ctx); void delivery_rewrite_spec(struct Delivery *ctx, char *filename); int delivery_copy_wheel_artifacts(struct Delivery *ctx); int delivery_copy_conda_artifacts(struct Delivery *ctx); diff --git a/src/deliverable.c b/src/deliverable.c index e7a2015..b534264 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -576,6 +576,21 @@ int delivery_index_wheel_artifacts(struct Delivery *ctx) { } return 0; } +char *delivery_get_spec_header(struct Delivery *ctx) { + char output[BUFSIZ]; + char stamp[100]; + const char *header = "# delivery_name: %s\n" + "# creation_time: %s\n" + "# conda_version: %s\n" + "# condabuild_version: %s\n"; + strftime(stamp, sizeof(stamp) - 1, "%c", ctx->info.time_info); + sprintf(output, header, + ctx->info.release_name, + stamp, + ctx->conda.tool_version, + ctx->conda.tool_build_version); + return strdup(output); +} void delivery_rewrite_spec(struct Delivery *ctx, char *filename) { char *package_name = NULL; |