[exim-cvs] Allow -RCX in document's version number

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Exim Git Commits Mailing List
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] Allow -RCX in document's version number
Gitweb: https://git.exim.org/exim-website.git/commitdiff/d55fd5ac70bd2a285a4294ca22d616eeb3f5eada
Commit:     d55fd5ac70bd2a285a4294ca22d616eeb3f5eada
Parent:     03ea187436509d50ec4feae2f203a01e6a0d1a6d
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Tue Dec 4 22:36:52 2018 +0100
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Tue Dec 4 22:37:16 2018 +0100


    Allow -RCX in document's version number


    The document directories are still w/o -RCX, to avoid
    spamming the webserver.
---
 script/gen | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)


diff --git a/script/gen b/script/gen
index 5596199..b794df6 100755
--- a/script/gen
+++ b/script/gen
@@ -134,8 +134,17 @@ sub do_doc {
     my $xml = XML::LibXML->new()->parse_file($xml_path) or die $!;


     ## Get the version number
-    my $version = $xml->findvalue('/book/bookinfo/revhistory/revision/revnumber');
-    die "Unable to get version number\n" unless defined $version && $version =~ /^\d+(\.\d+)*$/;
+    my $version = do {
+    my $version = $xml->findvalue('/book/bookinfo/revhistory/revision/revnumber');
+    die "Unable to get version number\n"
+        unless defined $version and $version =~ /^
+        (?<version>
+            \d+                # major
+            (?:\.\d+(?:\.\d+)?)?    # (minor(.patch))
+        )
+        (?:-RC\d+)?$/x;            # -RCX
+    $+{version};
+    };


     ## Prepend chapter filenames?
     my $prepend_chapter = $type eq 'filter' ? 'filter_' : '';