Bug 265364 - ports-mgmt/portlint: PORTVERSION check busted for versions like g20220630+2022.04
Summary: ports-mgmt/portlint: PORTVERSION check busted for versions like g20220630+202...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-21 20:36 UTC by Robert Clausecker
Modified: 2022-09-10 14:41 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (marcus)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2022-07-21 20:36:09 UTC
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.
Comment 1 Joe Marcus Clarke freebsd_committer freebsd_triage 2022-09-06 14:16:52 UTC
Added to my private git repo pending the next release.
Comment 2 Joe Marcus Clarke freebsd_committer freebsd_triage 2022-09-07 17:24:56 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-09-07 17:25:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9800743f0178a43313a7248f7ef2bcabfacef23d

commit 9800743f0178a43313a7248f7ef2bcabfacef23d
Author:     Joe Marcus Clarke <marcus@FreeBSD.org>
AuthorDate: 2022-09-07 17:21:52 +0000
Commit:     Joe Marcus Clarke <marcus@FreeBSD.org>
CommitDate: 2022-09-07 17:24:21 +0000

    ports-mgmt/portlint: Update to 2.19.13

    * Allow for a plus ('+') in other places in a PORTVERSION [1]
    * Check for .dkestop file installation [2]
    * Support the new Makefile WWW macro [3]

    PR:             265364 [1]
                    265551 [2]
                    266068 [3]
    Submitted by:   Robert Clausecker [1]
                    se [3]

 ports-mgmt/portlint/Makefile        |  2 +-
 ports-mgmt/portlint/src/portlint.pl | 71 +++++++++++++++++++++++++++----------
 2 files changed, 53 insertions(+), 20 deletions(-)
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2022-09-10 14:41:54 UTC
The check is still kind of weird.  Instead of the

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

I recommended, it now reads

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

i.e. there is an extra + in [0-9]+.  While this does not change the set of accepted versions, it should perhaps be looked into to make the regex less confusing.