bump-package-version updates rpm changelog

This commit is contained in:
Dmitry Maksyoma 2022-03-25 23:53:28 +13:00
parent c89a966ed6
commit 3ee95e3150
2 changed files with 28 additions and 1 deletions

View File

@ -12,7 +12,7 @@ add_debian_revision_to_new_version() {
}
bump_rpm() {
sed -i "s/^Version:.\+/Version: $new_version/" centos/kasmvncserver.spec
builder/bump-package-version-rpm "$new_version"
}
bump_deb() {

View File

@ -0,0 +1,27 @@
#!/bin/bash
set -eo pipefail
new_version="$1"
spec_file="centos/kasmvncserver.spec"
bump_version() {
sed -i "s/^Version:.\+/Version: $new_version/" "$spec_file"
}
detect_release_version() {
release_version=$(sed -ne 's/^Release:\s\+//p' "$spec_file" | sed -e 's/%.\+$//')
}
bump_changelog() {
detect_release_version
local date=$(date +'%a %b %d %Y')
local changelog_version="$new_version-$release_version"
local new_changelog_entry="* $date KasmTech <info@kasmweb.com> - $changelog_version\n- Upstream release"
sed -i -e "s/%changelog/%changelog\n$new_changelog_entry/" "$spec_file"
}
bump_version
bump_changelog