build-system: don't modify a file under git control

Instead of editing appdata/subsurface.appdata.xml in place, switch to our usual
pattern of modifying a .in file and add the resulting file to .gitignore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-09-15 07:27:07 -07:00
parent 7319b50a5d
commit 26d8beb766
3 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View file

@ -38,3 +38,4 @@ mobile-widgets/qml/kirigami
packaging/ios/install-root
packaging/ios/Info.plist
packaging/ios/Qt
appdata/subsurface.appdata.xml

View file

@ -1,4 +1,4 @@
#!/bin/sh
version=$(git describe --abbrev=12)
date=$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d)
sed -e "s|<release version=\"\" date=\"\" />|<release version=\"$version\" date=\"$date\" />|" -i appdata/subsurface.appdata.xml
sed -e "s|<release version=\"\" date=\"\" />|<release version=\"$version\" date=\"$date\" />|" appdata/subsurface.appdata.xml.in > appdata/subsurface.appdata.xml