summaryrefslogtreecommitdiffstats
path: root/tools/update-spec.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:38:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:38:37 +0000
commit23e67a23a7b57fa5cb6fc92bd0843c3707d56ef9 (patch)
tree88110359f0deb3bb263ade4ed0e888da6b7fdea4 /tools/update-spec.sh
parentAdding upstream version 24.5.1. (diff)
downloadpython-ansible-compat-upstream.tar.xz
python-ansible-compat-upstream.zip
Adding upstream version 24.6.0.upstream/24.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/update-spec.sh')
-rwxr-xr-xtools/update-spec.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/update-spec.sh b/tools/update-spec.sh
new file mode 100755
index 0000000..2e8ceee
--- /dev/null
+++ b/tools/update-spec.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+DIR=$(dirname "$0")
+VERSION=$(./tools/get-version.sh)
+mkdir -p "${DIR}/../dist"
+sed -e "s/VERSION_PLACEHOLDER/${VERSION}/" \
+ "${DIR}/../.config/python3-ansible-compat.spec" \
+ > "${DIR}/../dist/python3-ansible-compat.spec"
+
+export LC_ALL=en_US.UTF-8
+CHANGELOG=$(git log -n 20 --pretty="* %ad %an %ae \n- %s\n" --date=format:"%a %b %d %Y")
+NUM=$(grep -nr "%changelog" ${DIR}/../dist/python3-ansible-compat.spec|awk -F':' '{print $1}')
+let NUM_START=$NUM+1
+NUM_END=$(awk '{print NR}' ${DIR}/../dist/pytho3n-ansible-compat.spec|tail -n1)
+sed -i "${NUM_START},${NUM_END}d" ${DIR}/../dist/python3-ansible-compat.spec
+echo -e "$CHANGELOG" >> ${DIR}/../dist/python3-ansible-compat.spec