2022-03-25 11:53:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
new_version="$1"
|
2022-03-30 18:20:26 +02:00
|
|
|
specs="centos/kasmvncserver.spec
|
2022-04-04 18:31:55 +02:00
|
|
|
oracle/kasmvncserver.spec
|
|
|
|
opensuse/kasmvncserver.spec"
|
2022-03-25 11:53:28 +01:00
|
|
|
|
|
|
|
bump_version() {
|
2022-03-30 18:20:26 +02:00
|
|
|
sed -i "s/^Version:.\+/Version: $new_version/" "$1"
|
2022-03-25 11:53:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
detect_release_version() {
|
2022-03-30 18:20:26 +02:00
|
|
|
release_version=$(sed -ne 's/^Release:\s\+//p' "$1" | sed -e 's/%.\+$//')
|
2022-03-25 11:53:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bump_changelog() {
|
2022-03-30 18:20:26 +02:00
|
|
|
detect_release_version "$1"
|
2022-03-25 11:53:28 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2022-03-30 18:20:26 +02:00
|
|
|
sed -i -e "s/%changelog/%changelog\n$new_changelog_entry/" "$1"
|
2022-03-25 11:53:28 +01:00
|
|
|
}
|
|
|
|
|
2022-03-30 18:20:26 +02:00
|
|
|
IFS=$'\n'
|
|
|
|
for spec_file in $specs; do
|
|
|
|
bump_version $spec_file
|
|
|
|
bump_changelog $spec_file
|
|
|
|
done
|