2024-05-30 03:57:04 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
shopt -s nullglob dotglob
|
2024-02-22 11:31:44 +02:00
|
|
|
|
|
|
|
|
ver=$(git describe --dirty --long --match='v[0-9]*.[0-9]*' | cut -c 2- | cut -d - -f 1,2,4)
|
|
|
|
|
rpm_ver="${ver%%-*}"
|
|
|
|
|
rpm_rev="${ver#*-}"
|
|
|
|
|
rpm_numeric_rev="${rpm_rev%%-*}"
|
|
|
|
|
|
2024-07-14 16:19:38 +03:00
|
|
|
change1="* $(date +'%a %b %d %Y') $(git log -1 --format='%aN <%aE>') - ${rpm_ver}-${rpm_numeric_rev}"
|
|
|
|
|
change2="- $(git log -1 --format=%s)"
|
2024-02-22 11:31:44 +02:00
|
|
|
|
2024-07-14 16:19:38 +03:00
|
|
|
awk -v change1="${change1}" -v change2="${change2}" '/^%changelog/ {print; print change1; print change2; print ""; next} 1' gwebu-profile.spec.in \
|
2025-11-30 16:58:57 +02:00
|
|
|
>gwebu-profile.spec.tmp && mv gwebu-profile.spec.tmp gwebu-profile.spec.in
|
2024-04-03 10:28:31 +03:00
|
|
|
|
2024-07-14 16:19:38 +03:00
|
|
|
sed -i.bak "s/Version: .*/Version: ${rpm_ver}/" gwebu-profile.spec.in
|
|
|
|
|
sed -i.bak "s/Release: .*/Release: ${rpm_numeric_rev}/" gwebu-profile.spec.in
|
|
|
|
|
rm -f gwebu-profile.spec.in.bak
|
2024-05-30 03:57:04 +03:00
|
|
|
|
2025-03-09 00:25:26 +02:00
|
|
|
# git add gwebu-profile.spec.in
|
2024-05-30 03:57:04 +03:00
|
|
|
|
|
|
|
|
echo "gwebu-profile.spec.in changelog updated"
|