X-Git-Url: https://git.exim.org/exim-website.git/blobdiff_plain/03ea187436509d50ec4feae2f203a01e6a0d1a6d..094ad1c7b1db0e5132cf77098532a01079799795:/script/gen diff --git a/script/gen b/script/gen index 5596199..84657e7 100755 --- a/script/gen +++ b/script/gen @@ -134,8 +134,18 @@ 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 =~ /^ + (? + \d+ # major + (?:\.\d+(?:\.\d+)?)? # (minor(.patch)) + (?:\.\d+(?:\.\d+(?:\.\d+)?)?)? # (minor(.patch.(fixes))) + ) + (?:-RC\d+)?$/x; # -RCX + $+{version}; + }; ## Prepend chapter filenames? my $prepend_chapter = $type eq 'filter' ? 'filter_' : ''; @@ -507,11 +517,11 @@ __END__ =head1 NAME -gen.pl - Generate exim html documentation and website +gen - Generate exim html documentation and website =head1 SYNOPSIS -gen.pl [options] +gen [options] Options: --help display this help and exits @@ -591,7 +601,7 @@ Generates the exim website and HTML documentation. =head1 EXAMPLE - script/gen.pl \ + script/gen \ --web \ --spec docbook/*/spec.xml \ --filter docbook/*/filter.xml \