aboutsummaryrefslogtreecommitdiff
path: root/src/cli
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-04-23 13:48:57 -0400
committerGitHub <noreply@github.com>2026-04-23 13:48:57 -0400
commit017bc273aedf3f20512beeb78a2f513913e56305 (patch)
tree8450c64203a0b85d8e447974417c1bebce64fb3e /src/cli
parentd91c7bd6a35e2d979aeb1c2d11c6d8a21b57e173 (diff)
parent3c343e07936414981d5157b9713ff9b774b57fc5 (diff)
downloadstasis-017bc273aedf3f20512beeb78a2f513913e56305.tar.gz
Merge pull request #136 from jhunkeler/cmake-git-version-fixups
Bug Hunt 0x1000
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/stasis/args.c4
-rw-r--r--src/cli/stasis/stasis_main.c13
-rw-r--r--src/cli/stasis_indexer/readmes.c7
3 files changed, 17 insertions, 7 deletions
diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c
index 98b4479..e1c49fe 100644
--- a/src/cli/stasis/args.c
+++ b/src/cli/stasis/args.c
@@ -105,9 +105,7 @@ void usage(char *progname) {
strncat(opt_short, " ", sizeof(opt_short) - strlen(opt_short) - 1);
}
- const char *opt_fmt = " %%-%ds\t%%s\t\t%%s";
- size_t opt_fmt_len = snprintf(NULL, 0, opt_fmt, width);
- snprintf(tmp, sizeof(tmp) - opt_fmt_len, opt_fmt, width + 4);
+ snprintf(tmp, sizeof(tmp) - strlen(tmp), " %%-%ds\t%%s\t\t%%s", width + 4);
snprintf(output, sizeof(output), tmp, opt_long, opt_short, long_options_help[x]);
puts(output);
}
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c
index 697791a..01a126e 100644
--- a/src/cli/stasis/stasis_main.c
+++ b/src/cli/stasis/stasis_main.c
@@ -30,14 +30,19 @@ static void setup_sysconfdir() {
static void setup_python_version_override(struct Delivery *ctx, const char *version) {
// Override Python version from command-line, if any
- if (strlen(version)) {
+ if (version && strlen(version)) {
guard_free(ctx->meta.python);
ctx->meta.python = strdup(version);
if (!ctx->meta.python) {
SYSERROR("%s", "Unable to allocate bytes for python version override");
+ exit(1);
}
guard_free(ctx->meta.python_compact);
ctx->meta.python_compact = to_short_version(ctx->meta.python);
+ if (!ctx->meta.python_compact) {
+ SYSERROR("%s", "Unable to allocate bytes for python compact version override");
+ exit(1);
+ }
}
}
@@ -693,6 +698,12 @@ int main(int argc, char *argv[]) {
configure_delivery_context(&ctx);
configure_jfrog_cli(&ctx);
+ /*
+ delivery_free(&ctx);
+ tpl_free();
+ globals_free();
+ return 0;
+ */
runtime_apply(ctx.runtime.environ);
strncpy(env_name, ctx.info.release_name, sizeof(env_name) - 1);
diff --git a/src/cli/stasis_indexer/readmes.c b/src/cli/stasis_indexer/readmes.c
index 91c936f..749b1ee 100644
--- a/src/cli/stasis_indexer/readmes.c
+++ b/src/cli/stasis_indexer/readmes.c
@@ -63,13 +63,13 @@ int indexer_readmes(struct Delivery **ctx, const size_t nelem) {
fprintf(indexfp, " - Receipt: [STASIS input file](%s)\n", conf_name_relative);
char *pattern = NULL;
- asprintf(&pattern, "*%s*%s*",
+ if (asprintf(&pattern, "*%s*%s*",
latest_deliveries[i]->info.build_number,
- strstr((*ctx)->rules.release_fmt, "%p") ? latest_deliveries[i]->meta.python_compact : "" );
- if (!pattern) {
+ strstr((*ctx)->rules.release_fmt, "%p") ? latest_deliveries[i]->meta.python_compact : "" ) < 0) {
SYSERROR("%s", "Unable to allocate bytes for pattern");
return -1;
}
+
struct StrList *docker_images = get_docker_images(latest_deliveries[i], pattern);
if (docker_images
&& strlist_count(docker_images)
@@ -105,6 +105,7 @@ int indexer_readmes(struct Delivery **ctx, const size_t nelem) {
strstr((*ctx)->rules.release_fmt, "%p") ? current->meta.python_compact : "" );
if (!pattern) {
SYSERROR("%s", "Unable to allocate bytes for pattern");
+ fclose(indexfp);
return -1;
}