On Thu, Nov 25, 2021 at 04:45:06PM +0100, Omar Polo wrote:
> I wanted to share gelatod with a friend but the package lacks a HOMEPAGE
> and so `pkg_info gelatod' too.  I think it's handy to have a link in the
> description, even if the package in question it's not really useful
> outside of OpenBSD :)

OK kn

This makes me think:  Probably more ports use github.com as MASTER_SITES but
don't have HOMEPAGE set... in bsd.port.mk(5) we could default to
"https://github.com/author/repository"; for such ports and fix all of them.

What do you think?

> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/net/gelatod/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- Makefile  23 Nov 2021 23:48:05 -0000      1.3
> +++ Makefile  25 Nov 2021 15:44:34 -0000
> @@ -3,12 +3,14 @@
>  COMMENT =            CLAT configuration daemon for OpenBSD
>  V =                  1.3
>  DISTNAME =           gelatod-${V}
> +REVISION =           0
>  CATEGORIES =         net
>  
>  # BSD 2-clause
>  PERMIT_PACKAGE =     Yes
>  
>  MASTER_SITES =               
> https://github.com/fobser/gelatod/releases/download/v${V}/
> +HOMEPAGE =           https://github.com/fobser/gelatod
>  
>  MAINTAINER =         Klemens Nanni <[email protected]>

Here is a diff that yields the same HOMEPAGE for gelatod.

I would still have yet to grep the tree and REVISION bump effected ones,
but let's gauge interest first.


Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1562
diff -u -p -r1.1562 bsd.port.mk
--- bsd.port.mk 22 Nov 2021 11:01:47 -0000      1.1562
+++ bsd.port.mk 25 Nov 2021 20:25:59 -0000
@@ -1254,6 +1254,13 @@ HOMEPAGE ?= https://github.com/${GH_ACCO
 .else
 # Empty declarations to avoid "variable XXX is recursive" errors
 MASTER_SITES ?=
+
+# default to the repository URL if MASTER_SITES points to GitHub
+_GH_MASTER_URL = ${MASTER_SITES:Mhttps\://github.com/*}
+.  if !empty(_GH_MASTER_URL)
+# cut down to /author/repository
+HOMEPAGE ?= ${_GH_MASTER_URL:C,(https\://github.com(/[^/]+){2}).*,\1,1}
+.  endif
 .endif
 
 # I guess we're in the master distribution business! :)  As we gain mirror

Reply via email to