diff options
| -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:")) { | 
