diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-05-10 18:25:05 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-05-10 18:33:45 +0200 |
commit | a60851bd59afe2a36e839e3b3409e9b92ab447d2 (patch) | |
tree | f1e39cbaaaa366c051bba6905d1863ef398892c5 /searx/version.py | |
parent | 0aade75eaebb0bbf032274415937f25a8975297c (diff) | |
download | searxng-a60851bd59afe2a36e839e3b3409e9b92ab447d2.tar.gz searxng-a60851bd59afe2a36e839e3b3409e9b92ab447d2.zip |
[fix] version format string generated by 'git show'
Newer versions of git [1] do no longer support a format string that includes a minus
to remove leading zeros [2]. The format string '%Y.%m.%d' is more version rod.
[1] https://github.com/searxng/searxng/issues/2413#issuecomment-1542320387
[2] https://github.com/searxng/searxng/pull/2122/files
Closes: https://github.com/searxng/searxng/issues/2413
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/version.py')
-rw-r--r-- | searx/version.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/version.py b/searx/version.py index 9f3de38e9..7a368e366 100644 --- a/searx/version.py +++ b/searx/version.py @@ -59,7 +59,10 @@ def get_git_url_and_branch(): def get_git_version(): - git_commit_date_hash = subprocess_run(r"git show -s --date='format:%-Y.%-m.%-d' --format='%cd+%h'") + git_commit_date_hash = subprocess_run(r"git show -s --date='format:%Y.%m.%d' --format='%cd+%h'") + # Remove leading zero from minor and patch level / replacement of PR-2122 + # which depended on the git version: '2023.05.06+..' --> '2023.5.6+..' + git_commit_date_hash = git_commit_date_hash.replace('.0', '.') tag_version = git_version = git_commit_date_hash # add "+dirty" suffix if there are uncommited changes except searx/settings.yml |