Add zeek -V/--build-info

This adds a new utility called ci/collect-repo-info.py to produce a JSON
document that is then baked into the Zeek executable file. Further, when
creating a tarball via `make dist`, put a top-level repo-info.json file
in place that is picked when no .git directory exists.

Closes #1405
This commit is contained in:
Arne Welzel 2023-02-09 11:16:05 +01:00
parent 2b33645f06
commit 3284259561
9 changed files with 224 additions and 1 deletions

View file

@ -207,6 +207,7 @@ char version[] = VERSION;
#else
extern char version[];
#endif
extern const char zeek_build_info[];
const char* zeek::detail::command_line_policy = nullptr;
vector<string> zeek::detail::params;
@ -535,6 +536,12 @@ SetupResult setup(int argc, char** argv, Options* zopts)
exit(0);
}
if ( options.print_build_info )
{
fprintf(stdout, "%s", zeek_build_info);
exit(0);
}
if ( options.run_unit_tests )
options.deterministic_mode = true;