From: Colin Clark Date: Wed, 13 Mar 2024 09:50:29 +0000 (+0000) Subject: Include appstreamcli in ancillary files check X-Git-Tag: v2.4~16 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=74f99dec798bdaa2e18e86c3994a3018cdcadd2c Include appstreamcli in ancillary files check appstreamcli is used to lint org.geeqie.Geeqie.appdata.xml.in --- diff --git a/.github/workflows/check-build-actions.yml b/.github/workflows/check-build-actions.yml index 955a9e55..53a8e303 100644 --- a/.github/workflows/check-build-actions.yml +++ b/.github/workflows/check-build-actions.yml @@ -22,6 +22,7 @@ jobs: runs-on: ubuntu-22.04 steps: - run: sudo apt-get update + - run: sudo apt-get install appstream - run: sudo apt-get install build-essential libgtk-3-dev libgtk-3-bin - run: sudo apt-get install at-spi2-core - run: sudo apt-get install desktop-file-utils @@ -74,6 +75,7 @@ jobs: runs-on: ubuntu-22.04 steps: - run: sudo apt-get update + - run: sudo apt-get install appstream - run: sudo apt-get install at-spi2-core - run: sudo apt-get install build-essential libgtk-3-dev libgtk-3-bin - run: sudo apt-get install clang-tidy diff --git a/scripts/test-ancillary-files.sh b/scripts/test-ancillary-files.sh index bc593968..4325b75e 100755 --- a/scripts/test-ancillary-files.sh +++ b/scripts/test-ancillary-files.sh @@ -25,6 +25,7 @@ ## $1 Root of project sources ## ## Perform validity checks on project ancillary files: +## appdata ## desktop ## scripts ## ui @@ -209,4 +210,28 @@ $(find . -name "*.desktop.in") EOF fi +# Appdata lint +if [ -z "$(command -v appstreamcli)" ] +then + printf "ERROR: appstreamcli is not installed" + exit_status=1 +else + if ! result=$(appstreamcli validate org.geeqie.Geeqie.appdata.xml.in --pedantic --explain) + then + exit_status=1 + status="Error" + else + line_count=$(echo "$result" | wc --lines) + + if [ "$line_count" -gt 1 ] + then + status="Warning" + else + status="Passed" + fi + fi + + printf "%s: appstreamcli in org.geeqie.Geeqie.appdata.xml.in: \n%s\n" "$status" "$result" +fi + exit "$exit_status"