diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-04-21 14:38:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 14:38:32 -0400 |
| commit | d91c7bd6a35e2d979aeb1c2d11c6d8a21b57e173 (patch) | |
| tree | a9fab62b682e8b06c34192e447da6656ad034572 /src/cli/stasis_indexer | |
| parent | e05702d1818088439fd017786a036103062db358 (diff) | |
| parent | ee4c7beb65ddef497e9349d4ffc71d5bd58777cc (diff) | |
| download | stasis-d91c7bd6a35e2d979aeb1c2d11c6d8a21b57e173.tar.gz | |
Generate version string based on repository information
Diffstat (limited to 'src/cli/stasis_indexer')
| -rw-r--r-- | src/cli/stasis_indexer/helpers.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index 0debfe4..23e4f5a 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -313,13 +313,22 @@ int load_metadata(struct Delivery *ctx, const char *filename) { return -1; } + // Reserved for future use. + // i.e. adjust values based on the version of the software that produced the input + char *stasis_version = NULL; + char *stasis_version_branch = NULL; + while (fgets(line, sizeof(line) - 1, fp) != NULL) { char **parts = split(line, " ", 1); const char *name = parts[0]; char *value = parts[1]; strip(value); - if (!strcmp(name, "name")) { + if (!strcmp(name, "stasis_version")) { + stasis_version = strdup(value); + } else if (!strcmp(name, "stasis_version_branch")) { + stasis_version_branch = strdup(value); + } else if (!strcmp(name, "name")) { ctx->meta.name = strdup(value); } else if (!strcmp(name, "version")) { ctx->meta.version = strdup(value); @@ -364,6 +373,9 @@ int load_metadata(struct Delivery *ctx, const char *filename) { } guard_array_free(parts); } + + guard_free(stasis_version); + guard_free(stasis_version_branch); fclose(fp); return 0; |
