Usage: $(basename "$0") [OPTIONS] <new-version>
This script updates NEWS file and release dates in configure.ac and meson.build
-for a new util-linux release. It must be run from a stable/vX.Y branch.
+for a new util-linux release. It must be run from a stable/vX.Y branch, or from
+the master branch for devel versions.
Arguments:
- <new-version> Version in format X.Y, X.Y.Z, X.Y-rcN, or X.Y.Z-rcN
+ <new-version> Version in format X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN,
+ or X.Y-devel (master branch only)
Options:
-h, --help Show this help message
function validate_version() {
local version="$1"
- # Valid formats: X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN
- if [[ ! "$version" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?(-rc[0-9]+)?$ ]]; then
+ # Valid formats: X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN, X.Y-devel
+ if [[ ! "$version" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?(-rc[0-9]+|-devel)?$ ]]; then
echo "Error: Invalid version format '$version'" >&2
- echo "Valid formats: X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN" >&2
+ echo "Valid formats: X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN, X.Y-devel" >&2
return 1
fi
return 0
}
function validate_branch() {
+ local version="$1"
local current_branch
current_branch=$(git branch --show-current)
- if [[ ! "$current_branch" =~ ^stable/v[0-9]+\.[0-9]+$ ]]; then
- echo "Error: This script must be run from a stable/vX.Y branch" >&2
- echo "Current branch: $current_branch" >&2
- return 1
+ if [[ "$version" == *-devel ]]; then
+ if [[ "$current_branch" != "master" ]]; then
+ echo "Error: Devel versions can only be used on the master branch" >&2
+ echo "Current branch: $current_branch" >&2
+ return 1
+ fi
+ else
+ if [[ ! "$current_branch" =~ ^stable/v[0-9]+\.[0-9]+$ ]]; then
+ echo "Error: This script must be run from a stable/vX.Y branch" >&2
+ echo "Current branch: $current_branch" >&2
+ return 1
+ fi
fi
return 0
}
validate_version "$VERSION" || exit 1
# Validate branch
-validate_branch || exit 1
+validate_branch "$VERSION" || exit 1
function bump_news_version {
local version="$1"