File set_version_to of Package obs-service-kde

#!/bin/bash
set -euo pipefail

OLD_VERSION=$(sed -n -e 's,^version: \(.*\),\1,p' *.obsinfo | head -n 1)
# Replace occurence of VERSION
NEW_VERSION="${OLD_VERSION//VERSION/"$1"}"

# Strip version from obsinfo
sed -i"" "/^version:/d" *.obsinfo
# Add the right version
echo "version: ${NEW_VERSION}" >> *.obsinfo
# rename contents
rename "${OLD_VERSION}" "${NEW_VERSION}" *${OLD_VERSION}*
openSUSE Build Service is sponsored by