From: Karel Zak Date: Thu, 6 Mar 2025 10:09:13 +0000 (+0100) Subject: tools/git-version-bump: add from master branch X-Git-Tag: v2.41-rc2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=564ff893c4208b38592439ff38bd36181b915811;p=thirdparty%2Futil-linux.git tools/git-version-bump: add from master branch Signed-off-by: Karel Zak --- diff --git a/tools/git-version-bump b/tools/git-version-bump new file mode 100755 index 000000000..17db88028 --- /dev/null +++ b/tools/git-version-bump @@ -0,0 +1,36 @@ +#!/bin/bash +# +# git-version-bump - update versions and dates +# +# Copyright (C) 2025 Karel Zak +# +VERSION="$1" + +if [ -z "$VERSION" ]; then + echo "$(basename "$0") " + exit 1 +fi + +git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { + echo "Error: Not inside a Git repository." >&2 + exit 1 +} + +function bump_news_version { + local version="$1" + local date=$(date +"%b %d %Y") + + sed -i "1s/.*/util-linux ${version}: ${date} (the latest and greatest!)/" NEWS +} + +function bump_libblkid_date() { + local current_date=$(date +"%d-%b-%Y") + + sed -i "s/LIBBLKID_DATE=\"[0-9]\{2\}-[A-Z][a-z]\{2\}-[0-9]\{4\}\"/LIBBLKID_DATE=\"$current_date\"/g" ./configure.ac + sed -i "s/libblkid_date = '[0-9]\{2\}-[A-Za-z]\{3\}-[0-9]\{4\}'/libblkid_date = '$current_date'/g" meson.build +} + +bump_news_version "$VERSION" +bump_libblkid_date + +git commit -s -m "build-sys: update release dates" NEWS meson.build configure.ac