## $1 Root of project sources
##
## Perform validity checks on project ancillary files:
+## appdata
## desktop
## scripts
## ui
cd "$1" || exit 1
-if [ ! -d ".git" ] || [ ! -d "src" ] || [ ! -f "geeqie.1" ]
+if [ ! -d "src" ] || [ ! -f "geeqie.1" ]
then
printf '%s\n' "This is not a Geeqie project folder"
exit 1
$(awk 'BEGIN {FS="\047"} /option/ { if (substr($2,0,2) != "gq") { print $2 } }' meson_options.txt)
EOF
-# Check if all options are in the disabled checks
-while read -r line
-do
- if [ -n "$line" ]
- then
- res=$(grep "\-D$line=disabled" "$1/.github/workflows/check-build-actions.yml")
- if [ -z "$res" ]
+# Check if all options are in the disabled checks in a GitHub run
+# Directory .github is not in the source tar
+if [ -d ".github" ]
+then
+ while read -r line
+ do
+ if [ -n "$line" ]
then
- printf "ERROR; Option no disabled check in .github/workflows/check-build-actions.yml: %s\n" "$line"
- exit_status=1
+ res=$(grep "\-D$line=disabled" "$1/.github/workflows/check-build-actions.yml")
+ if [ -z "$res" ]
+ then
+ printf "ERROR; Option no disabled check in .github/workflows/check-build-actions.yml: %s\n" "$line"
+ exit_status=1
+ fi
fi
- fi
-done << EOF
+ done << EOF
$(awk 'BEGIN {FS="\047"} /option/ { if (substr($2,0,2) != "gq") { print $2 } }' meson_options.txt)
EOF
+fi
# Markdown lint
# Runs as a GitHub Action
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"