Bug 224002

Summary: ports-mgmt/portlint: DISTVERSION for new ports
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Individual Port(s)Assignee: Joe Marcus Clarke <marcus>
Status: In Progress ---    
Severity: Affects Only Me CC: tcberner
Priority: --- Flags: bugzilla: maintainer-feedback? (marcus)
Version: Latest   
Hardware: Any   
OS: Any   

Description Yuri Victorovich freebsd_committer 2017-11-30 21:33:13 UTC
New ports can be only committed with DISTVERSION, not PORTVERSION, when it factors into DISTFILES.
Comment 1 Joe Marcus Clarke freebsd_committer 2017-12-28 23:27:34 UTC
I don't see where this is stated in the Porter's Handbook.  One may need to use PORTVERSION if the proper version cannot be derived from DISTVERSION.  In particular:

" If the version contains letters, it might be needed to set PORTVERSION and not DISTVERSION"

I'd rather not add an error-prone check when things have been working fine for a while now.
Comment 2 Yuri Victorovich freebsd_committer 2017-12-31 10:02:57 UTC
Both tcberner@ abd mat@ say that this is a requirement.
They returned my patches countless times because portlint didn't complain about PORTVERSION.
Comment 3 Joe Marcus Clarke freebsd_committer 2017-12-31 15:28:20 UTC
I'm not sure.  I haven't been part of those conversations.  But as you have written this PR, I don't see what should be done that is in line with the porter's handbook.  If you can provide more details or a patch showing the precise check and how it relates to the PH, that would be helpful.
Comment 4 Yuri Victorovich freebsd_committer 2017-12-31 17:21:39 UTC
(In reply to Joe Marcus Clarke from comment #3)

@tcberner Tobias, could you please advice what is the best way to fix portlint so that it can warn about the wrongly used PORTVERSION?
Comment 5 Tobias C. Berner freebsd_committer 2018-01-01 17:43:10 UTC
How about something like
@@ -2583,6 +2583,11 @@
                        "specified, not both.");
        if ($newport) {
+               if ($tmp =~ /\nPORTVERSION.?=/) {
+                       &perror("WARN", $file, -1, "new ports should prefer DISTVERSION over PORTVERSION")
+               }
+       }
+    if ($newport) {
                print "OK: checking for existence of PORTREVISION in new port.\n"
                        if ($verbose);
                if ($tmp =~ /^PORTREVISION(.)?=/m) {

[1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-naming.html#makefile-versions
Comment 6 Joe Marcus Clarke freebsd_committer 2018-01-02 14:32:04 UTC
Thanks, Tobias.  I agree, this is where such a check would go, but I have a hard time reconciling this with the PH where it states that DISTVERSION might not be sufficient given the syntax of the DISTVERSION.  So would this not just cause more confusion for new porters?  Is there a reliable regex that would indicate that a PORTVERSION is being used where DISTVERSION would be better?