aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis_indexer/helpers.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-04-21 14:38:32 -0400
committerGitHub <noreply@github.com>2026-04-21 14:38:32 -0400
commitd91c7bd6a35e2d979aeb1c2d11c6d8a21b57e173 (patch)
treea9fab62b682e8b06c34192e447da6656ad034572 /src/cli/stasis_indexer/helpers.c
parente05702d1818088439fd017786a036103062db358 (diff)
parentee4c7beb65ddef497e9349d4ffc71d5bd58777cc (diff)
downloadstasis-d91c7bd6a35e2d979aeb1c2d11c6d8a21b57e173.tar.gz
Merge pull request #135 from jhunkeler/cmake-git-versionHEADmaster
Generate version string based on repository information
Diffstat (limited to 'src/cli/stasis_indexer/helpers.c')
-rw-r--r--src/cli/stasis_indexer/helpers.c14
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;