From 47e9f28019ac7c02c5b3a70924d3f98bdf9061ee Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 22:22:18 +0200 Subject: [PATCH] Add set-ver script --- README.md | 13 +++++++++++++ meson.build | 3 +++ scripts/set-version | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 scripts/set-version diff --git a/README.md b/README.md index 94e812e..a88e2d2 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,19 @@ Withou meson use: ./scripts/create-signatures GPGID ``` +##### Set Version Number + +Once the version number is set within meson.build, you can use + +``` +meson compile set-ver -C build +``` + +to set the version number in the man pages and README repology minversion. + +Use of the script without meson is discouraged because meson.build is +not touched by the script. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index 7d416ea..c84ea9a 100644 --- a/meson.build +++ b/meson.build @@ -362,6 +362,9 @@ run_target('output-hashes', run_target('create-sigs', command : ['scripts/create-signatures', get_option('gpg_id')]) +run_target('set-ver', + command : ['scripts/set-version', meson.project_version()]) + # 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/set-version b/scripts/set-version new file mode 100755 index 0000000..c4506cb --- /dev/null +++ b/scripts/set-version @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +# TODO man pages + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +# shellcheck disable=2034 +version="${1}" +sed -i -e "s/minversion\=[0-9]*\.[0-9]*.[0-9]*/minversion=$version/" README.md + + +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak.1.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-config.5.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-socket.7.md