Bug 224002 - ports-mgmt/portlint: DISTVERSION for new ports
Summary: ports-mgmt/portlint: DISTVERSION for new ports
Status: In Progress
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
Depends on:
Reported: 2017-11-30 21:33 UTC by Yuri Victorovich
Modified: 2018-01-02 14:32 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
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?