[geary/wip/restore-revno] Ensure client displays the revno where approrpiate



commit 56b3ce98332baae110e30bcd1c704d77d95598d7
Author: Michael Gratton <mike vee net>
Date:   Wed Aug 28 20:03:29 2019 +1000

    Ensure client displays the revno where approrpiate
    
    This ensures that the revno is always displayed in About, the Inspector,
    and at the top of log files if build from git.

 meson.build                                   | 14 +++++---------
 src/client/application/geary-application.vala |  8 ++++++--
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/meson.build b/meson.build
index 35da285c..7af17160 100644
--- a/meson.build
+++ b/meson.build
@@ -15,24 +15,19 @@ reference_tracking = get_option('ref_tracking')
 poodle = get_option('poodle')
 enable_valadoc = get_option('valadoc')
 
+revno = run_command('build-aux/git_version.py').stdout().strip()
+
 # Build type
 if get_option('profile') == 'development'
-  name_suffix = ' (Development)'
   profile = 'Devel'
-  vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
-  if vcs_tag == ''
-    version_suffix = '-devel'
-  else
-    version_suffix = '-@0@'.format(vcs_tag)
-  endif
+  name_suffix = ' (Development)'
 else
   profile = ''
   name_suffix = ''
-  version_suffix = ''
 endif
 
 geary_id = 'org.gnome.Geary@0@'.format(profile)
-geary_version = meson.project_version() + version_suffix
+geary_version = meson.project_version()
 
 # Some variables
 cc = meson.get_compiler('c')
@@ -210,6 +205,7 @@ conf.set_quoted('_VERSION', geary_version)
 conf.set_quoted('_APP_ID', geary_id)
 conf.set_quoted('_PROFILE', profile)
 conf.set_quoted('_NAME_SUFFIX', name_suffix)
+conf.set_quoted('_REVNO', revno)
 configure_file(output: 'config.h', configuration: conf)
 
 # Post-install scripts
diff --git a/src/client/application/geary-application.vala b/src/client/application/geary-application.vala
index 77307393..727cbaff 100644
--- a/src/client/application/geary-application.vala
+++ b/src/client/application/geary-application.vala
@@ -17,6 +17,7 @@ extern const string _APP_ID;
 extern const string _NAME_SUFFIX;
 extern const string _PROFILE;
 extern const string _VERSION;
+extern const string _REVNO;
 
 /**
  * The interface between Geary and the desktop environment.
@@ -278,6 +279,8 @@ public class GearyApplication : Gtk.Application {
         /// Application runtime information label
         info.add({ _("Geary version"), VERSION });
         /// Application runtime information label
+        info.add({ _("Geary revision"), _REVNO });
+        /// Application runtime information label
         info.add({ _("GTK version"),
                     "%u.%u.%u".printf(
                         Gtk.get_major_version(),
@@ -481,7 +484,7 @@ public class GearyApplication : Gtk.Application {
             "copyright", string.join("\n", COPYRIGHT_1, COPYRIGHT_2),
             "license-type", Gtk.License.LGPL_2_1,
             "logo-icon-name", APP_ID,
-            "version", VERSION,
+            "version", _REVNO == "" ? VERSION : "%s (%s)".printf(VERSION, _REVNO),
             "website", WEBSITE,
             "website-label", WEBSITE_LABEL,
             "title", _("About %s").printf(NAME),
@@ -683,9 +686,10 @@ public class GearyApplication : Gtk.Application {
             int mutex_token = yield this.controller_mutex.claim_async();
             if (this.controller == null) {
                 message(
-                    "%s %s prefix=%s exec_dir=%s is_installed=%s",
+                    "%s %s%s prefix=%s exec_dir=%s is_installed=%s",
                     NAME,
                     VERSION,
+                    _REVNO != "" ? " (%s)".printf(_REVNO) : "",
                     INSTALL_PREFIX,
                     exec_dir.get_path(),
                     this.is_installed.to_string()


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