[gimp] desktop: use appstreamcli for testing instead of appstream-util.



commit 73f1f944c5383487434621d9c4586472782fcae0
Author: Jehan <jehan girinstud io>
Date:   Tue May 3 21:48:28 2022 +0200

    desktop: use appstreamcli for testing instead of appstream-util.
    
    As told to us, this is the reference AppStream file testing tool, and it
    understands more of the spec.
    
    Also since commit 73e2e701da, appstream-util chokes on newer url types
    from the spec. These tags are now supported both in appstream-util and
    appstreamcli source code, except that appstreamcli had release 0.15.3,
    available in Debian testing, whereas there were apparently no recent
    appstream-glib/util release (and none since 2020). So for these various
    reasons, let's go with the appstreamcli tool.
    
    The only downside is that appstream package (where appstreamcli lives)
    is not available on MSYS2, but since it's only an optional test tool for
    XML files which should be common on all platforms, it's probably
    acceptable.

 configure.ac               | 22 +++++++++++-----------
 desktop/meson.build        | 10 +++++-----
 desktop/test-appdata.sh.in |  4 ++--
 meson.build                |  4 ++--
 4 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a8820b5c14..d0cd76496a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2656,24 +2656,24 @@ if test "x$with_xvfb_run" != "xno"; then
 fi
 AM_CONDITIONAL(HAVE_XVFB_RUN, test "x$have_xvfb_run" = "xyes")
 
-##########################
-# Check for appstream-util
-##########################
+########################
+# Check for appstreamcli
+########################
 
 AC_ARG_WITH(appdata-test,  [  --without-appdata-test  do not validate the appdata file])
 
-have_appstream_util="no (disabled)"
+have_appstreamcli="no (disabled)"
 if test "x$with_appdata_test" != "xno"; then
-  AC_PATH_PROG(APPSTREAM_UTIL, appstream-util, no)
+  AC_PATH_PROG(APPSTREAM_UTIL, appstreamcli, no)
   if test "x$APPSTREAM_UTIL" != "xno"; then
-    have_appstream_util="yes"
+    have_appstreamcli="yes"
   else
-    have_appstream_util="no (appstream-util not found)"
+    have_appstreamcli="no (appstreamcli not found)"
   fi
 fi
-AM_CONDITIONAL(HAVE_APPSTREAM_UTIL, test "x$have_appstream_util" = "xyes")
-if test "x$have_appstream_util" = "xyes"; then
-  have_appstream_util="yes (this test requires network access; --without-appdata-test to disable)"
+AM_CONDITIONAL(HAVE_APPSTREAM_UTIL, test "x$have_appstreamcli" = "xyes")
+if test "x$have_appstreamcli" = "xyes"; then
+  have_appstreamcli="yes (this test requires network access; --without-appdata-test to disable)"
 fi
 
 
@@ -3321,7 +3321,7 @@ Optional Modules:
 
 Tests:
   Use xvfb-run               $have_xvfb_run
-  Test appdata               $have_appstream_util
+  Test appdata               $have_appstreamcli
   Test desktop file          $have_desktop_file_validate
 
 Documentation:
diff --git a/desktop/meson.build b/desktop/meson.build
index 3b2efd7af0..e6c24f0fb4 100644
--- a/desktop/meson.build
+++ b/desktop/meson.build
@@ -101,10 +101,10 @@ if desktop_validate.found()
   )
 endif
 
-if appstream_util.found()
+if appstreamcli.found()
   test('appdata_file',
-    appstream_util,
-    args: [ 'validate-relax', appdatafile ],
+    appstreamcli,
+    args: [ 'validate', appdatafile ],
     env: [
       'GIMP_TESTING_ABS_TOP_BUILDDIR=' + meson.build_root(),
     ],
@@ -112,8 +112,8 @@ if appstream_util.found()
   )
 
   test('metainfo_file',
-    appstream_util,
-    args: [ 'validate-relax', metainfofile ],
+    appstreamcli,
+    args: [ 'validate', metainfofile ],
     env: [
       'GIMP_TESTING_ABS_TOP_BUILDDIR=' + meson.build_root(),
     ],
diff --git a/desktop/test-appdata.sh.in b/desktop/test-appdata.sh.in
index 733bcfcb9d..45cf9af0c9 100755
--- a/desktop/test-appdata.sh.in
+++ b/desktop/test-appdata.sh.in
@@ -2,8 +2,8 @@
 
 # TODO: use validate-strict when the last errors for a strict validation
 # are fixed.
-appstream-util validate-relax ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml && \
-appstream-util validate-relax ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp-data-extras.metainfo.xml && \
+appstreamcli validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml && \
+appstreamcli validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/gimp-data-extras.metainfo.xml && \
 if [ $(expr @GIMP_MICRO_VERSION@ % 2) = 0 ]; then
   grep TODO ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml
   if [ $? = 0 ]; then
diff --git a/meson.build b/meson.build
index bf42690ffe..d95776374e 100644
--- a/meson.build
+++ b/meson.build
@@ -1020,7 +1020,7 @@ xsltproc            = find_program('xsltproc')
 intltool_merge      = find_program('intltool-merge')
 desktop_validate    = find_program('desktop-file-validate', required: false)
 
-appstream_util = find_program('appstream-util', required: get_option('appdata-test'))
+appstreamcli = find_program('appstreamcli', required: get_option('appdata-test'))
 
 # Check for doc generation tools
 
@@ -1863,7 +1863,7 @@ final_message = [
 '',
 '''Tests:''',
 '''  Use xvfb-run         @0@'''.format(xvfb_run.found()),
-'''  Test appdata         @0@'''.format(appstream_util.found()),
+'''  Test appdata         @0@'''.format(appstreamcli.found()),
 '',
 '''Documentation:''',
 '''  libgimp API Reference: @0@'''.format(gi_docgen.found()),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]