diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-12 08:54:35 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-12 08:54:35 -0400 |
commit | a2ccdd2a14b79ebb3770ea3eb9c220c32f804969 (patch) | |
tree | 68087f03f315e22b83ea59cd546546a5cb5c1c25 /src/deliverable.c | |
parent | ea192301461c22067e8632fc1cdfc680003eb858 (diff) | |
download | stasis-a2ccdd2a14b79ebb3770ea3eb9c220c32f804969.tar.gz |
Only initialize the release name, and deferred package arrays if required
Diffstat (limited to 'src/deliverable.c')
-rw-r--r-- | src/deliverable.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/deliverable.c b/src/deliverable.c index 906517d..8dd24f6 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -218,8 +218,6 @@ void delivery_free(struct Delivery *ctx) { } void delivery_init_dirs_stage2(struct Delivery *ctx) { - path_store(&ctx->storage.output_dir, PATH_MAX, ctx->storage.output_dir, ctx->info.build_name); - path_store(&ctx->storage.build_dir, PATH_MAX, ctx->storage.build_dir, ctx->info.build_name); path_store(&ctx->storage.build_recipes_dir, PATH_MAX, ctx->storage.build_dir, "recipes"); path_store(&ctx->storage.build_sources_dir, PATH_MAX, ctx->storage.build_dir, "sources"); @@ -491,18 +489,28 @@ static int populate_delivery_ini(struct Delivery *ctx) { // Delivery metadata consumed populate_mission_ini(&ctx); - if (delivery_format_str(ctx, &ctx->info.release_name, ctx->rules.release_fmt)) { - fprintf(stderr, "Failed to generate release name. Format used: %s\n", ctx->rules.release_fmt); - return -1; + if (!ctx->info.release_name) { + if (delivery_format_str(ctx, &ctx->info.release_name, ctx->rules.release_fmt)) { + fprintf(stderr, "Failed to generate release name. Format used: %s\n", ctx->rules.release_fmt); + return -1; + } + } + if (!ctx->info.build_name) { + delivery_format_str(ctx, &ctx->info.build_name, ctx->rules.build_name_fmt); + } + if (!ctx->info.build_number) { + delivery_format_str(ctx, &ctx->info.build_number, ctx->rules.build_number_fmt); } - delivery_format_str(ctx, &ctx->info.build_name, ctx->rules.build_name_fmt); - delivery_format_str(ctx, &ctx->info.build_number, ctx->rules.build_number_fmt); // Best I can do to make output directories unique. Annoying. delivery_init_dirs_stage2(ctx); - ctx->conda.conda_packages_defer = strlist_init(); - ctx->conda.pip_packages_defer = strlist_init(); + if (!ctx->conda.conda_packages_defer) { + ctx->conda.conda_packages_defer = strlist_init(); + } + if (!ctx->conda.pip_packages_defer) { + ctx->conda.pip_packages_defer = strlist_init(); + } for (size_t z = 0, i = 0; i < ini->section_count; i++) { if (startswith(ini->section[i]->key, "test:")) { |