diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-03-27 16:31:18 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-03-27 16:31:18 -0400 |
commit | e817b38090defab01e64bc3516ea474215bfcb09 (patch) | |
tree | 5c11f2fbdc713ed49b65ce839e0550023ff5f0b2 /src | |
parent | a72d5b8e451127606b0a47fb771486cab0e2c275 (diff) | |
download | stasis-e817b38090defab01e64bc3516ea474215bfcb09.tar.gz |
Store latest revision number in "REVISION"
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/stasis_indexer/stasis_indexer_main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/stasis_indexer_main.c b/src/cli/stasis_indexer/stasis_indexer_main.c index 2f6808c..279af5a 100644 --- a/src/cli/stasis_indexer/stasis_indexer_main.c +++ b/src/cli/stasis_indexer/stasis_indexer_main.c @@ -368,6 +368,24 @@ int main(const int argc, char *argv[]) { } } + const char *revisionfile = "REVISION"; + msg(STASIS_MSG_L1, "Writing revision file: %s\n", revisionfile); + if (!pushd(workdir)) { + FILE *revisionfp = fopen(revisionfile, "w+"); + if (!revisionfp) { + SYSERROR("Unable to open revision file for writing: %s", revisionfile); + rmtree(workdir); + exit(1); + } + fprintf(revisionfp, "%d\n", get_latest_rc(local, strlist_count(metafiles))); + fclose(revisionfp); + popd(); + } else { + SYSERROR("%s", workdir); + rmtree(workdir); + exit(1); + } + const char *manifestfile = "TREE"; msg(STASIS_MSG_L1, "Writing manifest: %s\n", manifestfile); if (!pushd(workdir)) { |