whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Improve version checking
Date Thu, 18 Feb 2021 23:11:51 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3253ce5  Improve version checking
3253ce5 is described below

commit 3253ce5226f8c00f3494db8f423266cf402267d7
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Feb 18 23:11:42 2021 +0000

    Improve version checking
---
 tools/download_check.rb | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index bbcb425..ef14522 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -448,22 +448,17 @@ def _checkDownloadPage(path, tlp, version)
             unless $vercheck[base].first == 'archive'
               stem = base[0..-(ext.size+2)]
               # version must include '.', e.g. xxx-m.n.oyyy
-              if stem =~ %r{^(.+?)-(\d+\..+)$}
-                # $1 = part before version
-                # $2 = version + any suffix, e.g. -bin, -src (or other)
-                pfx = $1
-                ver = $2
-                # does version have a suffix which is really part of the name?
+              if stem =~ %r{^.+?-(\d+(?:\.\d+)+)(.*)$}
+                # $1 = version
+                # $2 any suffix, e.g. -bin, -src (or other)
+                ver = $1 # main version
+                suff = $2
+                # does version have a suffix such as beta1, M3 etc?
                 # jmeter needs _ here
-                if ver =~ %r{^(\d+(?:\.\d+)+)[-_]}
-                  ver1 = $1 # save version
-                  # -source-release etc => Camel
-                  if %w(-bin -src _src -source-release -linux-64bit -mac-64bit -windows-64bit).include?
$2 or $2 =~ %r{^-(bin|beta\d)-} # allow for -bin-scala...
-                    pfx = stem
-                    ver = ver1
-                  end
+                if suff =~ %r{^(-RC\d|-rc\d|-incubating|-ALPHA|[-.]?M\d+|[-~]?(alpha|beta)\d?(?:-\d)?)}
+                  ver = ver + $1
                 end
-                $versions[ver][pfx] << ext
+                $versions[ver][stem] << ext
               else
                 W "Cannot parse #{base} for version"
               end


Mime
View raw message