diff options
author | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-06-04 20:19:15 +0200 |
---|---|---|
committer | Romain Bouvier <skunnyk@alteroot.org> | 2020-06-17 00:00:05 +0200 |
commit | d3dde202976b2aad41847aad8d3c4d0004dbc752 (patch) | |
tree | 86015cfc676f11c226f46efbaa6ffacb7033a6a5 /helpers | |
parent | c9c4e832e30049f51fe039cf8abd9ece002bd9fa (diff) | |
download | xfce4-dev-tools-d3dde202976b2aad41847aad8d3c4d0004dbc752.tar.gz |
Add two new helpers
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/xfce-get-release-notes | 24 | ||||
-rwxr-xr-x | helpers/xfce-update-news | 30 |
2 files changed, 54 insertions, 0 deletions
diff --git a/helpers/xfce-get-release-notes b/helpers/xfce-get-release-notes new file mode 100755 index 0000000..d37f65f --- /dev/null +++ b/helpers/xfce-get-release-notes @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +SILENT=$2 +LINE_LENGTH=72 +LAST_TAG=$(git describe --abbrev=0) + +if [ -n "$1" ]; then + LAST_TAG=$1 +else + if [ "$SILENT" != "silent" ]; then + echo "Changes since $LAST_TAG:" + fi +fi + +git log --format=%s ${LAST_TAG}..HEAD | \ + grep -v "Updates for release" | \ + grep -v "Update translation" | \ + grep -v "Add new translation" | \ + grep -v "Back to development" | \ + while read line; do \ + echo "- $line" | \ + fold -s -w $LINE_LENGTH - | \ + sed -e "s/^[^ ]/&/g" + done diff --git a/helpers/xfce-update-news b/helpers/xfce-update-news new file mode 100755 index 0000000..8aa73b7 --- /dev/null +++ b/helpers/xfce-update-news @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +COMPONENT=$1 +VERSION=$2 +WRITE_TAG=$3 +LAST_TAG=$(git describe --abbrev=0) +RELEASE_NOTES="/tmp/release_notes" +TRANSLATIONS="/tmp/translations" + +# Push the release notes and translations text to tmp files +xfce-get-release-notes $LAST_TAG silent > $RELEASE_NOTES +xfce-get-translations "$LAST_TAG" "HEAD" silent > $TRANSLATIONS + +cleanup () { + rm $RELEASE_NOTES + rm $TRANSLATIONS +} + +# Check if there is a NEWS file +if [ "$WRITE_TAG" = "WRITETAG" ]; then + printf '%s\n\n%s\n%s\n' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)" +elif [ ! -f "NEWS" ]; then + echo "There is no 'NEWS' file. Changelog since $VERSION:" + printf '%s\n======\n%s\n%s\n\n%s' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)" + cleanup +else + printf '%s\n======\n%s\n%s\n\n%s' $VERSION "$(cat $RELEASE_NOTES)" "$(cat $TRANSLATIONS)" "$(cat NEWS)" > NEWS + cleanup + git diff NEWS +fi |