build/linux: Create pseudo-release on AppData if nightly builds

This is specially useful for Flatpak since now the
correct version will be shown on 'flatpak list'
This commit is contained in:
Bruno Lopes 2025-11-11 09:40:36 -03:00
parent 93ad913bc1
commit 6f6329744d
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -510,7 +510,9 @@ printf "(INFO): configuring $APP_ID.appdata.xml\n"
find "$USR_DIR/share/metainfo" \( -iname *.appdata.xml -and ! -iname $APP_ID*.appdata.xml \) -execdir mv "{}" $APP_ID.appdata.xml \;
sed -i "s/org.gimp.GIMP</${APP_ID}</g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
sed -i "s/gimp.desktop/${APP_ID}.desktop/g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
sed -i "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
sed -i "/<release[^>]*date=\"TODO\"[^>]*>/,/<\/release>/d" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
#https://github.com/probonopd/go-appimage/issues/272
#v=$(awk -F"'" '/version:/ {print $2; exit}' meson.build | sed 's/-/~/' | tr '[:upper:]' '[:lower:]'); grep -q "version=\"$v\"" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml" || sed -i "/<releases>/a <release version=\"$v\" date=\"$(date --iso-8601)\" type=\"snapshot\"></release>" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
printf "\e[0Ksection_end:`date +%s`:${ARCH}_source\r\e[0K\n"

View file

@ -789,7 +789,8 @@
{
"type": "shell",
"commands": [
"sed -i '/<release[^>]*date=\"TODO\"[^>]*>/,/<\/release>/d' desktop/org.gimp.GIMP.appdata.xml.in.in"
"sed -i \"/<release[^>]*date=\\\"TODO\\\"[^>]*>/,/<\\/release>/d\" desktop/org.gimp.GIMP.appdata.xml.in.in",
"v=$(awk -F\"'\" '/version:/ {print $2; exit}' meson.build | sed 's/-/~/g' | tr '[:upper:]' '[:lower:]'); grep -q \"version=\\\"$v\\\"\" desktop/org.gimp.GIMP.appdata.xml.in.in || sed -i \"/<releases>/a <release version=\\\"$v\\\" date=\\\"$(date --iso-8601)\\\" type=\\\"snapshot\\\"></release>\" desktop/org.gimp.GIMP.appdata.xml.in.in"
]
}
],