[Bug 265364] ports-mgmt/portlint: PORTVERSION check busted for versions like g20220630+2022.04

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 21 Jul 2022 20:36:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265364

            Bug ID: 265364
           Summary: ports-mgmt/portlint: PORTVERSION check busted for
                    versions like g20220630+2022.04
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: marcus@FreeBSD.org
          Reporter: fuz@fuz.su
             Flags: maintainer-feedback?(marcus@FreeBSD.org)
          Assignee: marcus@FreeBSD.org

I would like to add a port made of two independently versioned components.  The
first component is fetched from git with no versioning (so version g20220630),
the second component is a more conventional version (Apr2022 which I translate
into 2022.04).   So the complete PORTVERSION ends up being g20220630+2022.04

Unfortunately portlint doesn't like this version.  The regex used for checking
portversions is

    $portversion =~ /^[0-9]*[A-Za-z]?[0-9]*(\.[0-9]*[A-Za-z]?[0-9+]*)*$/

Which only permits port versions with a + after a dot and the + must be
succeeded by numbers.

How about changing it to

    $portversion =~ /^[0-9]*[A-Za-z]?[0-9]*([.+][0-9]*[A-Za-z]?[0-9]*)*$/

to fix the detection of port versions?  Note that this regular expression still
matches port versions with nothing after the +, but now it also matches my port
version.

-- 
You are receiving this mail because:
You are the assignee for the bug.