[epiphany] Improve tech preview version computation



commit 3cebbef663bc632e1392d6624d7d17764d680177
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Nov 16 11:59:41 2017 -0600

    Improve tech preview version computation
    
    This did not work on the SDK builder: the version got set to an empty
    string. I'm not sure why, but my guess is the command was not executed
    from the source root. Meson documentation says the execution directory
    is undefined, so let's make sure to get that right, at least.

 compute-tech-preview-version.sh |   10 ++++++++++
 meson.build                     |    7 ++++++-
 2 files changed, 16 insertions(+), 1 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 5f861b2..4833631 100644
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,12 @@ tech_preview = get_option('tech_preview')
 conf.set10('TECH_PREVIEW', tech_preview)
 
 if tech_preview
-  conf.set_quoted('VERSION', run_command('git', 'describe').stdout().strip())
+  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


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