Commit 4c34c7e1 authored by Michael Catanzaro's avatar Michael Catanzaro

Use meson's vcs_tag(), but not for network requests

I just learned about meson's vcs_tag() function. We can use this to get
rid of our compute-tech-preview-version.sh script.

In implementing this, I discovered that we're sending the git hash along
to the sync server and safe browsing server. Let's not do that. Only use
the VCS version when displaying things locally, not in network requests.
parent 2da39504
#!/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
......@@ -31,6 +31,7 @@
#include "ephy-settings.h"
#include "ephy-smaps.h"
#include "ephy-snapshot-service.h"
#include "ephy-vcs-version.h"
#include "ephy-web-app-utils.h"
#include <gio/gio.h>
......@@ -270,7 +271,7 @@ ephy_about_handler_handle_about (EphyAboutHandler *handler,
char *version;
GtkIconInfo *icon_info;
version = g_strdup_printf (_("Version %s"), VERSION);
version = g_strdup_printf (_("Version %s"), VCSVERSION);
icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
"org.gnome.Epiphany",
......
#define VCSVERSION "@VCSVERSION@"
......@@ -40,22 +40,30 @@ 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
conf.set_quoted('VERSION', meson.project_version())
configure_file(
output: 'config.h',
configuration: conf
)
if tech_preview
vcs_tag(
input: 'ephy-vcs-version.h.in',
output: 'ephy-vcs-version.h',
replace_string: '@VCSVERSION@'
)
else
version_conf = configuration_data()
version_conf.set('VCSVERSION', meson.project_version())
configure_file(
input: 'ephy-vcs-version.h.in',
output: 'ephy-vcs-version.h',
configuration: version_conf
)
endif
glib_requirement = '>= 2.52.0'
gtk_requirement = '>= 3.22.13'
nettle_requirement = '>= 3.2'
......
......@@ -29,6 +29,7 @@
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-string.h"
#include "ephy-vcs-version.h"
#include "ephy-web-app-utils.h"
#include <errno.h>
......@@ -99,7 +100,7 @@ option_version_cb (const gchar *option_name,
gpointer data,
GError **error)
{
g_print ("%s %s\n", _("Web"), VERSION);
g_print ("%s %s\n", _("Web"), VCSVERSION);
exit (EXIT_SUCCESS);
return FALSE;
......
......@@ -52,6 +52,7 @@
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-string.h"
#include "ephy-vcs-version.h"
#include "ephy-web-app-utils.h"
#include "ephy-zoom.h"
......@@ -651,7 +652,7 @@ window_cmd_show_about (GSimpleAction *action,
#else
"program-name", _("Epiphany Technology Preview"),
#endif
"version", VERSION,
"version", VCSVERSION,
"copyright", "Copyright © 2002–2004 Marco Pesenti Gritti\n"
"Copyright © 2003–2018 The Web Developers",
"artists", artists,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment