Add adjust-epoch script

This commit is contained in:
project-repo 2023-04-13 19:17:56 +02:00
commit f99c39516d
3 changed files with 31 additions and 0 deletions

View file

@ -294,6 +294,21 @@ meson compile fuzz -C build
If you want to use a different directory, configure cagebreak with
`-Dcorpus=OTHERDIRECTORY` or call `./scripts/fuzz OTHERDIRECTORY`.
##### Adjusting Epoch
To facilitate the creation of reproducible man pages an arbitrary release
time has to be set in `meson.build`:
```
meson compile adjust-epoch -C build
```
or
```
./scripts/adjust-epoch
```
### GCC and -fanalyzer
Cagebreak should compile with any reasonably new gcc or clang. Consider

View file

@ -350,6 +350,9 @@ run_target('devel-install',
run_target('fuzz',
command : ['scripts/fuzz', get_option('corpus')])
run_target('adjust-epoch',
command : ['scripts/adjust-epoch'])
# Test Suite
test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel')

13
scripts/adjust-epoch Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Copyright 2023, project-repo and the cagebreak contributors
# SPDX-License-Identifier: MIT
if [[ -n ${MESON_SOURCE_ROOT} ]]
then
# shellcheck disable=2164
cd "${MESON_SOURCE_ROOT}"
fi
# shellcheck disable=2034
ssepoch=$(date +%s)
sed -i -e "/secssinceepoch \=/s/[0-9]*$/$ssepoch/" meson.build