grass
grass copied to clipboard
configure: enable read Git hash and date from file
Enable configure to read GRASS_HEADERS_GIT_HASH and GRASS_HEADERS_GIT_DATE from a file include/VERSION_GIT (if it exist). That file can be generated in the process of packaging the release tarball, leading to consistent versioning even without Git.
The VERSION_GIT file is expected to contain:
cat include/VERSION_GIT
7d9bc3610
2024-02-17T15:36:05+00:00
First step in solving #3430.
Updated with fixed tests.
if test "$GIT" != "no" ; then only checks for presence of git the command/program.
Added include/VERSION_GIT-file generation script.
(Initially I planned to have this code in the workflow file, but decided it is better to have it in source).
I tested this PR by creating include/VERSION_GIT and than removing .git directory (which is not located in tarball):
checking for include/VERSION_GIT... yes
fatal: not a git repository (or any of the parent directories): .git
grep VERSION_GIT include/Make/Platform.make
GRASS_VERSION_GIT = exported
In this case Git hash should be propagated from the file @nilason right?
I tested this PR by creating
include/VERSION_GITand than removing.gitdirectory (which is not located in tarball):checking for include/VERSION_GIT... yes fatal: not a git repository (or any of the parent directories): .gitgrep VERSION_GIT include/Make/Platform.make GRASS_VERSION_GIT = exportedIn this case Git hash should be propagated from the file @nilason right?
True, corrected this with d9bca18.
Any thoughts on this one, @landam , @neteler , anyone?