e0fd81e322
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/dotnet-build-reference-packages#e7b448e64a2c6a997dad61c7a46792f0b8508104
49 lines
1015 B
Bash
Executable File
49 lines
1015 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Usage:
|
|
# ./update-release commit-sha
|
|
|
|
set -euo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
print_usage() {
|
|
echo " Usage:"
|
|
echo " ./update-release commit-sha"
|
|
echo ""
|
|
echo "Update the source-build-reference-packages package to the upstream commit sha"
|
|
}
|
|
|
|
positional_args=()
|
|
while [[ "$#" -gt 0 ]]; do
|
|
arg="${1}"
|
|
case "${arg}" in
|
|
-h|--help)
|
|
print_usage
|
|
exit 0
|
|
;;
|
|
*)
|
|
positional_args+=("$1")
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
spec_file=dotnet-build-reference-packages.spec
|
|
|
|
commit_sha=${positional_args[0]:-}
|
|
if [[ -z ${commit_sha} ]]; then
|
|
echo "error: missing commit sha"
|
|
exit 1
|
|
fi
|
|
|
|
set -x
|
|
|
|
sed -i -E "s|^%global commit [a-f0-9]+$|%global commit ${commit_sha}|" "$spec_file"
|
|
sed -i -E "s|^(Release: +[[:digit:]]+\.)([[:digit:]]{8})git|\1$(date '+%4Y%m%d')git|" "$spec_file"
|
|
|
|
spectool -g "${spec_file}"
|
|
|
|
comment="Update to upstream commit ${commit_sha:0:7}"
|
|
|
|
rpmdev-bumpspec --comment="$comment" $spec_file
|