[epiphany] Revert "Give up on using 'git describe' to show tech preview version"



commit a12c3a602681f3a170b2d2376c55cba7633036c5
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Nov 23 10:06:28 2017 -0600

    Revert "Give up on using 'git describe' to show tech preview version"
    
    This reverts commit cc6e329bad649b2ecf1d371910dbc3537bbc4f33.

 compute-tech-preview-version.sh |   10 ++++++++++
 meson.build                     |   20 ++++++++++++++++----
 src/window-commands.c           |    3 +--
 3 files changed, 27 insertions(+), 6 deletions(-)
---
diff --git a/compute-tech-preview-version.sh b/compute-tech-preview-version.sh
new file mode 100755
index 0000000..9db2f77
--- /dev/null
+++ b/compute-tech-preview-version.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# This script is a not-very-elaborate workaround for the fact that Meson's
+# run_command() executes commands in an unspecified directory. All we need to
+# do here is ensure we run git describe in the source directory.
+#
+# It would be nice if we didn't need to use a script for something so simple.
+
+cd $MESON_SOURCE_ROOT
+git describe
diff --git a/meson.build b/meson.build
index 535d499..4b176f0 100644
--- a/meson.build
+++ b/meson.build
@@ -31,14 +31,26 @@ conf.set_quoted('LOCALEDIR', localedir)
 conf.set_quoted('PKGDATADIR', pkgdatadir)
 conf.set_quoted('PKGLIBEXECDIR', pkglibexecdir)
 conf.set_quoted('SOURCE_ROOT', meson.source_root())
-conf.set_quoted('VERSION', meson.project_version())
-
-conf.set10('DEVELOPER_MODE', get_option('developer_mode'))
-conf.set10('TECH_PREVIEW', get_option('tech_preview'))
 
 # FIXME: Get rid of this option. This feature should be polished up and enabled unconditionally.
 conf.set10('ENABLE_HTTPS_EVERYWHERE', get_option('https_everywhere'))
 
+conf.set10('DEVELOPER_MODE', get_option('developer_mode'))
+
+tech_preview = get_option('tech_preview')
+conf.set10('TECH_PREVIEW', tech_preview)
+
+if tech_preview
+  msg = 'Computing Epiphany Tech Preview version: '
+  res = run_command(join_paths(meson.source_root(), 'compute-tech-preview-version.sh'))
+  assert(res.returncode() == 0, msg + 'FAIL (script returned nonzero exit status)')
+  tech_preview_version = res.stdout().strip()
+  message(msg + tech_preview_version)
+  conf.set_quoted('VERSION', tech_preview_version)
+else
+  conf.set_quoted('VERSION', meson.project_version())
+endif
+
 configure_file(
   output: 'config.h',
   configuration: conf
diff --git a/src/window-commands.c b/src/window-commands.c
index 4951593..93d9616 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -647,11 +647,10 @@ window_cmd_show_about (GSimpleAction *action,
   gtk_show_about_dialog (window ? GTK_WINDOW (window) : NULL,
 #if !TECH_PREVIEW
                          "program-name", _("Web"),
-                         "version", VERSION,
 #else
                          "program-name", _("Epiphany Technology Preview"),
-                         "version", __DATE__ " " __TIME__,
 #endif
+                         "version", VERSION,
                          "copyright", "Copyright © 2002–2004 Marco Pesenti Gritti\n"
                          "Copyright © 2003–2017 The Web Developers",
                          "artists", artists,


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