tcl / fossil manifest / mkversion
I have ported the C code "mkversion.c" from Richard Hipp into Tcl "mkversion.tcl". This allows a "manifest.txt" to be created from the two files "manifest" and "manifest.uuid" generated by Fossil. As shown in the example, this can be read into tcl packages and used for a procedure build-info TIP-599.
There is an example code for a tcl package "example.tcl". Here I make use of the fact that after the "package provide" I use the "info script" to remember the directory path at the time when the package is loaded in order to reload "manifest.txt" later from the same directory.
"Makefile.in" and "configure.ac" are code snippets to show how this can be integrated.
Generate "manifest.txt":
tclsh mkversion.tcl > manifest.txt
example for "manifest.txt":
MANIFEST_UUID a3bfd52a0fa73f6a5fef8f6d6518e7f18d14e1b631ea0f498fe3a36b8f4d48c1
MANIFEST_VERSION {[a3bfd52a0f]}
FOSSIL_BUILD_HASH 5f1c834a9aa56c09d208d6b949d7dbb8
MANIFEST_DATE {2024-04-18 12:13:27}
MANIFEST_YEAR 2024
MANIFEST_NUMERIC_DATE 20240418
MANIFEST_NUMERIC_TIME 121327
RELEASE_VERSION 1.1
RELEASE_VERSION_NUMBER 10100
RELEASE_RESOURCE_VERSION 1,1,0,0
examples for "::example::build-info":
::example::build-info
1.1+a3bfd52a0f.2024-04-18T12:13:27Z.tcl.noarch
::example::build-info commit
a3bfd52a0fa73f6a5fef8f6d6518e7f18d14e1b631ea0f498fe3a36b8f4d48c1
::example::build-info version
1.1
::example::build-info patchlevel
1.1
::example::build-info compiler
tcl.noarch
::example::build-info path
/usr/local/lib/example1.1