From bc8261c5d2020f5d767f6c0f0c53ae7c703839a5 Mon Sep 17 00:00:00 2001 From: Nicolas Gelot Date: Wed, 17 Jul 2019 08:55:00 +0200 Subject: [PATCH] Fix searx version Searx version is useful for external report tool like stats.searx.xyz. Then is better for spot project to track the upstream tag to avoid conflict during the next rebase. The new spot tag format is the folowing: `+`. I suggest to use the spot tag with the date format `YYYYMMDD`. A full tag should be `v0.15.0+20190719`. Ref: #36 --- searx/templates/eelo/base.html | 2 +- searx/version.py | 6 ++++++ searx/webapp.py | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/searx/templates/eelo/base.html b/searx/templates/eelo/base.html index 31fb8160f..94dae554a 100644 --- a/searx/templates/eelo/base.html +++ b/searx/templates/eelo/base.html @@ -89,7 +89,7 @@ e Foundation 2018-2019, {{ _('Powered by') }} Spot - {{ searx_version }}.
An open-source metasearch engine forked from Searx. + {{ metadata_version }}.
An open-source metasearch engine forked from Searx {{ searx_version }}. {{ _('About') }} {{ _('Privacy') }} diff --git a/searx/version.py b/searx/version.py index 473eb722d..11bbcbffe 100644 --- a/searx/version.py +++ b/searx/version.py @@ -22,3 +22,9 @@ try: VERSION_STRING = get_distribution("searx").version except DistributionNotFound: VERSION_STRING = "0.0.0" + +try: + SEARX_VERSION, METADATA_VERSION = VERSION_STRING.split("+") +except ValueError: + SEARX_VERSION = VERSION_STRING + METADATA_VERSION = "" diff --git a/searx/webapp.py b/searx/webapp.py index fea6046e2..48ccef934 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -52,7 +52,7 @@ from searx.utils import ( get_static_files, get_result_templates, get_themes, gen_useragent, dict_subset, prettify_url, match_language ) -from searx.version import VERSION_STRING +from searx.version import VERSION_STRING, SEARX_VERSION, METADATA_VERSION from searx.languages import language_codes as languages from searx.search import Search from searx.search_database import RedisCache @@ -333,7 +333,8 @@ def render(template_name, override_theme=None, **kwargs): if locale in rtl_locales and 'rtl' not in kwargs: kwargs['rtl'] = True - kwargs['searx_version'] = VERSION_STRING + kwargs['searx_version'] = SEARX_VERSION + kwargs['metadata_version'] = METADATA_VERSION kwargs['method'] = request.preferences.get_value('method') -- GitLab