From fe7cda41653e8190eadd7f6eac40d0aacfd914af Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Wed, 8 Nov 2023 23:00:58 +0100 Subject: [PATCH] [git] Handle tiny versions by default (#176) The default regex does not work for tiny versions. While those versions are not common, they are not uncommon either. --- update.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/update.rb b/update.rb index 8cfbf8b4..1a13071b 100644 --- a/update.rb +++ b/update.rb @@ -13,11 +13,12 @@ CACHE_DIR = ARGV[1] OUTPUT_DIR = ARGV[2] OPTIONAL_PRODUCT = ARGV[3] -# This regex is used in absence of anything else -# This is more lenient from semver, but disallows MAJOR=0 as well -# It also allows MAJOR.MINOR, which is quite common -DEFAULT_VERSION_REGEX = '^v?(?[1-9]\d*)\.(?0|[1-9]\d*)\.?(?0|[1-9]\d*)?$' -DEFAULT_TAG_TEMPLATE = "{{major}}{% if minor %}.{{minor}}{% if patch %}.{{patch}}{%endif%}{%endif%}" +# This regex is used in absence of anything else. +# This is more lenient from semver, but disallows MAJOR=0 as well. +# It allows MAJOR.MINOR, MAJOR.MINOR.PATCH and MAJOR.MINOR.PATCH.TINY versions, +# with or without a 'v' prefix, which are quite common. +DEFAULT_VERSION_REGEX = '^v?(?[1-9]\d*)\.(?\d+)(\.(?\d+)(\.(?\d+))?)?$' +DEFAULT_TAG_TEMPLATE = "{{major}}.{{minor}}{% if patch %}.{{patch}}{% if tiny %}.{{tiny}}{%endif%}{%endif%}" # extensions.partialClone=true is also set up in the workflow. # See also https://stackoverflow.com/a/65746233/374236 @@ -112,7 +113,7 @@ def get_releases(product, config, i) fetch_git_releases(dir, config) return get_releases_from_git(dir, config) elsif type != nil - puts "Handled by #{type} script, skipping" + puts "#{product} handled by #{type} script, skipping" return {} else puts "Undetected method for #{product}"