[gexiv2/wip/Jehan/no-warnings-only-gerrors] tools: fix gexiv2-dump build.




commit 6a56d2b7795ba63069554ffb64f6c4872bd65182
Author: Jehan <jehan girinstud io>
Date:   Mon Dec 14 23:24:33 2020 +0100

    tools: fix gexiv2-dump build.
    
    metadata.get_tag_interpreted_string() outputs a warning on the CI
    because it is deprecated.
    And metadata.try_get_tag_interpreted_string() outputs another warning
    because (at the opposite) is it "not available in gexiv2 0.12.1. Use
    gexiv2 >= 0.12.2" (which is normal as we are a dev version leading to
    0.12.2).
    So adding --disable-since-check to vala_args (which I found by testing
    randomly as vala_args parameter to executable() is documented nowhere on
    meson docs!).

 tools/gexiv2-dump.vala | 12 ++++++++----
 tools/meson.build      |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/tools/gexiv2-dump.vala b/tools/gexiv2-dump.vala
index 0532c64..3227338 100644
--- a/tools/gexiv2-dump.vala
+++ b/tools/gexiv2-dump.vala
@@ -38,10 +38,14 @@ void usage() {
 
 void dump_tags(GExiv2.Metadata metadata, string[] tags) throws Error {
     foreach (string tag in tags) {
-        print("%-64s%s\n",
-            tag,
-            metadata.get_tag_interpreted_string(tag)
-        );
+        try {
+            print("%-64s%s\n",
+                tag,
+                metadata.try_get_tag_interpreted_string(tag)
+            );
+        } catch (Error err) {
+            stderr.printf("Unable to get the interpreted string for metadata tag %s: %s\n", tag, 
err.message);
+        }
     }
 }
 
diff --git a/tools/meson.build b/tools/meson.build
index 4ab697d..302141d 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -3,5 +3,6 @@ if vapi_available
              'gexiv2-dump.vala',
              include_directories : include_directories('..'),
              dependencies : [gobject, vapi, gio],
+             vala_args: ['--disable-since-check'],
              link_with : gexiv2)
 endif


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