Skip to content

Commit

Permalink
Merge pull request #5 from Alexander-Wilms/master
Browse files Browse the repository at this point in the history
add script for updating the .metainfo.xml file from CHANGELOG.txt
  • Loading branch information
sunderme authored Oct 14, 2021
2 parents 2e715ac + 36f1884 commit abb795d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions changelog2metainfo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

. .github/scripts/get-version.sh > /dev/null
RELEASE_OPENING_TAG="<release date=\"$RELEASE_DATE\" version=\"$TXS_VERSION\">"
DESCRIPTION_OPENING_TAG="<description>"
LIST_OPENING_TAG="<ul>"
CHANGELOG=$(sed '/^[[:space:]]*$/d' utilities/manual/CHANGELOG.txt | tail -n +2 | awk 'NR==2,/TeXstudio/' | head -n -1 | sed -e 's|-|<li>|g' | sed -e 's|$|</li>|g' | sed -e 's|<li>\s\{1,\}|<li>|g' )
CHANGELOG="${CHANGELOG//
/\\n}"
LIST_CLOSING_TAG="</ul>"
DESCRIPTION_CLOSING_TAG="</description>"
RELEASE_CLOSING_TAG="</release>"

sed -i '/releases/,/releases/{//!d}' utilities/texstudio.metainfo.xml

if [ "$CHANGELOG" != "<li></li>" ]; then
RELEASE_TAG=$RELEASE_OPENING_TAG$DESCRIPTION_OPENING_TAG$LIST_OPENING_TAG$CHANGELOG$LIST_CLOSING_TAG$DESCRIPTION_CLOSING_TAG$RELEASE_CLOSING_TAG
else
RELEASE_TAG=$RELEASE_OPENING_TAG$RELEASE_CLOSING_TAG
fi

sed -e "s|<releases>|<releases>$RELEASE_TAG|g" -i utilities/texstudio.metainfo.xml
echo $RELEASE_TAG
cp utilities/texstudio.metainfo.xml utilities/texstudio.metainfo.xml.bak
xmllint --format utilities/texstudio.metainfo.xml.bak > utilities/texstudio.metainfo.xml && \
rm utilities/texstudio.metainfo.xml.bak
appstream-util validate-relax utilities/texstudio.metainfo.xml
1 change: 1 addition & 0 deletions release_CALLTHISONE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if [[ -e /home/benito ]]; then eval `keychain -q --eval --agents ssh id_rsa `; f

OWNDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $OWNDIR/checkversion.sh
source $OWNDIR/changelog2metainfo.sh
# $OWNDIR/createsrctar1.sh
# $OWNDIR/createpkg.sh --release
# $OWNDIR/create_releasenotes3.sh should probably be pushed to github somewhere (or into index.html)
Expand Down

0 comments on commit abb795d

Please sign in to comment.