diff --git a/check-news.sh b/check-news.sh index e7e8fa6bb..24a2ea10b 100755 --- a/check-news.sh +++ b/check-news.sh @@ -63,6 +63,23 @@ check_version() esac } +has_verify_latest_version() +{ + appstream-util 2>&1 | grep -q get-latest-version + return $? +} + +verify_latest_version() +{ + VERSION=$1 + FILE=$SRC_ROOT/"$2" + LATEST_VERSION=`appstream-util get-latest-version "$FILE" | tr -d '\d'` + if [ "$LATEST_VERSION" != "$VERSION" ] ; then + echo "Expected latest version $VERSION in $FILE, got $LATEST_VERSION" + exit 1 + fi +} + SRC_ROOT=${MESON_DIST_ROOT:-"./"} if [ $# -lt 1 ] ; then usage ; fi @@ -76,6 +93,14 @@ if [ $# -eq 0 ] ; then fi for i in $@ ; do + case "$i" in + *"metainfo"*) + if has_verify_latest_version ; then + verify_latest_version $VERSION "$i" + fi + ;; + esac + check_version $VERSION "$i" done diff --git a/meson.build b/meson.build index 181d21920..f7f5a705f 100644 --- a/meson.build +++ b/meson.build @@ -537,7 +537,7 @@ if is_stable find_program('check-news.sh').full_path(), '@0@'.format(meson.project_version()), 'NEWS', - 'org.gnome.Evince.appdata.xml.in' + 'org.gnome.Evince.metainfo.xml.in' ) else meson.add_dist_script(