diff options
author | Gaƫl Bonithon <gael@xfce.org> | 2021-11-27 09:41:46 +0100 |
---|---|---|
committer | Romain Bouvier <skunnyk@alteroot.org> | 2022-02-07 21:31:34 +0000 |
commit | 2ae47732a54ebfdbfa9c8e938e6e3be28c204e73 (patch) | |
tree | 67d08a7c0a7077118d0d7bdcbdc60db8cc22fa68 | |
parent | 639984b37056c786da601d413949fa197d9b864b (diff) | |
download | xfce4-dev-tools-2ae47732a54ebfdbfa9c8e938e6e3be28c204e73.tar.gz |
xfce-update-news: Add release date and adjust separator
-rwxr-xr-x | helpers/xfce-update-news | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/helpers/xfce-update-news b/helpers/xfce-update-news index 399420a..9298bee 100755 --- a/helpers/xfce-update-news +++ b/helpers/xfce-update-news @@ -3,21 +3,25 @@ COMPONENT=$1 VERSION=$2 WRITE_TAG=$3 +SEPARATOR=$(printf '=%.s' $(seq -s ' ' 1 ${#VERSION})) LAST_TAG=$(git describe --abbrev=0) RELEASE_NOTES=$(xfce-get-release-notes "$LAST_TAG" silent) TRANSLATIONS=$(xfce-get-translations "$LAST_TAG" "HEAD" silent) if [ "$WRITE_TAG" = "WRITETAG" ]; then # Use release note from NEWS if possible, they may have been edited - if [ -f "NEWS" ] && [ "$VERSION" = "$(head -n 1 NEWS)" ]; then - sed '/^[[:space:]]*$/q' NEWS | sed 's/======//' + if [ -f "NEWS" ] && [ "$VERSION" = "$(sed -n -E '1 s/^([.0-9]+).*/\1/p' NEWS)" ]; then + sed -E '/^[[:space:]]*$/q; s/^([.0-9]+).*/\1/; s/^=+$//' NEWS else printf '%s\n\n%s\n%s\n' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS" fi elif [ ! -f "NEWS" ]; then echo "There is no 'NEWS' file. Changelog since $VERSION:" - printf '%s\n======\n%s\n%s\n\n%s' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS" + printf '%s (%s)\n%s\n%s\n%s\n\n%s' \ + $VERSION $(date -I) $SEPARATOR "$RELEASE_NOTES" "$TRANSLATIONS" else - printf '%s\n======\n%s\n%s\n\n%s\n' $VERSION "$RELEASE_NOTES" "$TRANSLATIONS" "$(cat NEWS)" > NEWS + printf '%s (%s)\n%s\n%s\n%s\n\n%s\n' \ + $VERSION $(date -I) $SEPARATOR "$RELEASE_NOTES" "$TRANSLATIONS" "$(cat NEWS)" \ + > NEWS git diff NEWS fi |