bump-package-version-rpm: support multiple specs per dir

This commit is contained in:
Dmitry Maksyoma 2023-04-05 01:49:56 +12:00
parent 76618a3e0b
commit 8372a91d53
No known key found for this signature in database

View File

@ -3,9 +3,13 @@
set -eo pipefail
new_version="$1"
specs="centos/kasmvncserver.spec
oracle/kasmvncserver.spec
opensuse/kasmvncserver.spec"
spec_dirs=(centos oracle opensuse)
spec_files() {
for d in "${spec_dirs[@]}"; do
ls "$d"/*.spec
done
}
bump_version() {
sed -i "s/^Version:.\+/Version: $new_version/" "$1"
@ -25,8 +29,7 @@ bump_changelog() {
sed -i -e "s/%changelog/%changelog\n$new_changelog_entry/" "$1"
}
IFS=$'\n'
for spec_file in $specs; do
for spec_file in $(spec_files); do
bump_version $spec_file
bump_changelog $spec_file
done