From f99c39516dffff6eac94919ffb47d088caf6c7c1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:17:56 +0200 Subject: [PATCH] Add adjust-epoch script --- README.md | 15 +++++++++++++++ meson.build | 3 +++ scripts/adjust-epoch | 13 +++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 scripts/adjust-epoch diff --git a/README.md b/README.md index 03a0fc2..2b01291 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/meson.build b/meson.build index f43de32..4d3d01c 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/scripts/adjust-epoch b/scripts/adjust-epoch new file mode 100644 index 0000000..362c840 --- /dev/null +++ b/scripts/adjust-epoch @@ -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