Currently setting GH_TAGNAME automatically populates DISTNAME (and hence
PKGNAME) and WRKDIST, based on the contents of GH_TAGNAME, with a leading
'v' stripped off. Often this is helpful but other times it isn't, requiring
overriding defaults.

We can be a bit smarter by only stripping v when it's followed by what looks
like a version number (optionally - . or _, followed by a digit). Also add a few
more commonly seen prefixes so that the automatic naming comes into play more
often.

This means renaming a distfile in a couple of existing ports to match (shown
in the diff) but I think that's a small price to pay for less mess in other
ports. If this goes in I can do a sweep and get rid of unnecessary manual
setting of DISTNAME/PKGNAME/WRKDIST that will go away as a result.
(The only other ports I've touched in this particular diff are the ones that
*need* changing).

I've put it into a bulk build to make sure I didn't miss anything, assuming
there are no problems with that - any comments/concerns/OKs?



Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1515
diff -u -p -r1.1515 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       26 Jan 2020 12:51:47 -0000      1.1515
+++ infrastructure/mk/bsd.port.mk       10 Feb 2020 12:17:34 -0000
@@ -609,7 +609,7 @@ GH_ACCOUNT ?=
 GH_PROJECT ?=
 
 .if !empty(GH_PROJECT) && !empty(GH_TAGNAME)
-DISTNAME ?=    ${GH_PROJECT}-${GH_TAGNAME:C/^v//}
+DISTNAME ?=    
${GH_PROJECT}-${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
 .endif
 
 PKGNAME ?= ${DISTNAME}
@@ -873,7 +873,7 @@ _WRKDIRS += ${WRKOBJDIR}/${_WRKDIR_STEM}
 _WRKDIRS += ${WRKOBJDIR_MFS}/${_WRKDIR_STEM}
 
 .if !empty(GH_TAGNAME)
-WRKDIST ?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^v//}
+WRKDIST ?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^[vV]([0-9])/\1/}
 .elif !empty(GH_COMMIT)
 WRKDIST ?= ${WRKDIR}/${GH_PROJECT}-${GH_COMMIT}
 .else
Index: devel/gtest/distinfo
===================================================================
RCS file: /cvs/ports/devel/gtest/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- devel/gtest/distinfo        23 Apr 2017 11:14:47 -0000      1.3
+++ devel/gtest/distinfo        10 Feb 2020 12:17:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (googletest-release-1.8.0.tar.gz) = 
WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=
-SIZE (googletest-release-1.8.0.tar.gz) = 1281617
+SHA256 (googletest-1.8.0.tar.gz) = WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=
+SIZE (googletest-1.8.0.tar.gz) = 1281617
Index: editors/featherpad/Makefile
===================================================================
RCS file: /cvs/ports/editors/featherpad/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- editors/featherpad/Makefile 13 Jan 2020 19:31:41 -0000      1.11
+++ editors/featherpad/Makefile 10 Feb 2020 12:17:34 -0000
@@ -32,6 +32,4 @@ CONFIGURE_ARGS =      -DCMAKE_CXX_FLAGS="${CX
 
 NO_TEST =      Yes
 
-WRKDIST =      ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:S/^V//}
-
 .include <bsd.port.mk>
Index: editors/featherpad/distinfo
===================================================================
RCS file: /cvs/ports/editors/featherpad/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- editors/featherpad/distinfo 13 Jan 2020 19:31:41 -0000      1.9
+++ editors/featherpad/distinfo 10 Feb 2020 12:17:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (FeatherPad-V0.12.1.tar.gz) = 
wy1mIANZHWEnMefHCGpcfYxZCTFBxBTslw1oYFCZx08=
-SIZE (FeatherPad-V0.12.1.tar.gz) = 791670
+SHA256 (FeatherPad-0.12.1.tar.gz) = 
wy1mIANZHWEnMefHCGpcfYxZCTFBxBTslw1oYFCZx08=
+SIZE (FeatherPad-0.12.1.tar.gz) = 791670
Index: editors/texworks/Makefile
===================================================================
RCS file: /cvs/ports/editors/texworks/Makefile,v
retrieving revision 1.49
diff -u -p -r1.49 Makefile
--- editors/texworks/Makefile   12 Jul 2019 20:46:06 -0000      1.49
+++ editors/texworks/Makefile   10 Feb 2020 12:17:34 -0000
@@ -18,8 +18,6 @@ REVISION-main =               3
 
 EPOCH =                        0
 
-WRKDIST =              ${WRKDIR}/texworks-release-${V}
-
 CATEGORIES =           editors print
 HOMEPAGE =             http://www.tug.org/texworks/
 MAINTAINER =           Edd Barrett <[email protected]>
Index: editors/texworks/distinfo
===================================================================
RCS file: /cvs/ports/editors/texworks/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- editors/texworks/distinfo   30 Dec 2018 12:11:56 -0000      1.7
+++ editors/texworks/distinfo   10 Feb 2020 12:17:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (texworks-release-0.6.2.tar.gz) = 
IohcEdkmVLDLofSAj8mqPC/dPlQ1/Ynf+aoeZ2WKYzk=
-SIZE (texworks-release-0.6.2.tar.gz) = 11508277
+SHA256 (texworks-0.6.2.tar.gz) = IohcEdkmVLDLofSAj8mqPC/dPlQ1/Ynf+aoeZ2WKYzk=
+SIZE (texworks-0.6.2.tar.gz) = 11508277
Index: misc/feathernotes/Makefile
===================================================================
RCS file: /cvs/ports/misc/feathernotes/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- misc/feathernotes/Makefile  10 Jan 2020 15:01:15 -0000      1.6
+++ misc/feathernotes/Makefile  10 Feb 2020 12:17:34 -0000
@@ -28,6 +28,4 @@ RUN_DEPENDS = devel/desktop-file-utils \
 
 NO_TEST =      Yes
 
-WRKDIST =      ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:S/^V//}
-
 .include <bsd.port.mk>
Index: misc/feathernotes/distinfo
===================================================================
RCS file: /cvs/ports/misc/feathernotes/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- misc/feathernotes/distinfo  10 Jan 2020 15:01:15 -0000      1.4
+++ misc/feathernotes/distinfo  10 Feb 2020 12:17:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (FeatherNotes-V0.5.1.tar.gz) = 
aCZucohsJyWiDg5ulBkkb8wmr4+JonNgMaCw+XiA7GA=
-SIZE (FeatherNotes-V0.5.1.tar.gz) = 335890
+SHA256 (FeatherNotes-0.5.1.tar.gz) = 
aCZucohsJyWiDg5ulBkkb8wmr4+JonNgMaCw+XiA7GA=
+SIZE (FeatherNotes-0.5.1.tar.gz) = 335890
Index: x11/paper-icon-theme/Makefile
===================================================================
RCS file: /cvs/ports/x11/paper-icon-theme/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- x11/paper-icon-theme/Makefile       12 Jul 2019 20:51:19 -0000      1.6
+++ x11/paper-icon-theme/Makefile       10 Feb 2020 12:25:52 -0000
@@ -2,14 +2,11 @@
 
 COMMENT=               modern freedesktop flat icon theme
 
-V=                     1.5.0
-WRKDIST=               ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME}
-PKGNAME=               ${GH_PROJECT}-${V}
-REVISION=              1
-
 GH_ACCOUNT=            snwh
 GH_PROJECT=            paper-icon-theme
-GH_TAGNAME=            v.${V}
+GH_TAGNAME=            v.1.5.0
+REVISION=              1
+
 CATEGORIES=            x11
 
 HOMEPAGE=              https://snwh.org/paper
Index: x11/paper-icon-theme/distinfo
===================================================================
RCS file: /cvs/ports/x11/paper-icon-theme/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- x11/paper-icon-theme/distinfo       23 Jun 2018 14:32:19 -0000      1.3
+++ x11/paper-icon-theme/distinfo       10 Feb 2020 12:25:52 -0000
@@ -1,2 +1,2 @@
-SHA256 (paper-icon-theme-.1.5.0.tar.gz) = 
YvId/pXs5IHlxjVIDzI0fxrSfqZrLvBSb+eZCQspjs4=
-SIZE (paper-icon-theme-.1.5.0.tar.gz) = 48464220
+SHA256 (paper-icon-theme-1.5.0.tar.gz) = 
YvId/pXs5IHlxjVIDzI0fxrSfqZrLvBSb+eZCQspjs4=
+SIZE (paper-icon-theme-1.5.0.tar.gz) = 48464220

Reply via email to