On Thu, Nov 25, 2021 at 09:33:52PM +0100, Omar Polo wrote:
> Klemens Nanni <k...@openbsd.org> writes:
> 
> > 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?
> >
> > [...]
> >
> > 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.
> 
> Came up with the following query against sqlports
> 
> select p.fullpkgpath
>   from _paths p
>   join _ports pp on pp.fullpkgpath = p.id
>   join _mastersites ms on ms.fullpkgpath = p.id
>  where pp.homepage is null and ms.value like 'https://github.com%';
> 
> probably not the best one but works and finds 25 ports affected, it
> should save some grepping eventually :)
> 
> (it's important to match against 'https://github.com%' and not only
> '%github.com%' or '%github%' like I initially did because it otherwise
> picks up for e.g. stuff like proxy.golang.org/github.com/...)

Thanks for the query!  Here is the output:

        archivers/deco
        archivers/deco
        devel/arduino-esp32
        devel/arduino-esp8266
        devel/cargo-generate-vendor
        devel/harfbuzz,-icu
        devel/harfbuzz
        devel/xtensa-lx106-elf/gcc
        fonts/cascadia-code
        fonts/mada
        games/irrlamb
        graphics/mypaint-brushes
        graphics/mypaint-brushes2
        graphics/ocaml-graphics
        graphics/scrot
        mail/fdm
        mail/greyscanner
        misc/rlwrap
        misc/zzuf
        multimedia/webvfx
        net/gelatod
        net/oicb
        net/telegram-purple
        print/system-config-printer
        productivity/mcds
        security/tls-attacker
        sysutils/patchelf
        x11/lablgtk3

Back then I ran those through `make show=HOMEPAGE' with my diff to
verify and one port stood out, printing an empty HOMEPAGE.

        devel/xtensa-lx106-elf/gcc 

Now I took the time to see why and it turns out that this one points to
github.com in MASTER_SITES1 not MASTER_SITES, which sqlports's
`_mastersites` table accounts for with the `N` key.

My diff only cares about the "primary" master site;  one could expand it
but I don't think it's worth it, so far.

So let's tweak your query to focus on MASTER_SITES (no [0-9]) alone:

        $ cd /usr/ports
        $ cat ./gh-homepage.sql
        select p.fullpkgpath
          from _paths p
          join _ports pp on pp.fullpkgpath = p.id
          join _mastersites ms on ms.fullpkgpath = p.id
         where pp.homepage is null and ms.value like 'https://github.com%'
           and ms.N is null;

This excludes xtensa-lx106-elf/gcc and prints proper repository URLs for
all ports (after turnings FULLPKGPATHS into ports directory paths):

        $ sqlite3 < ./gh-homepage.sql /usr/local/share/sqlports |
            cut -d, -f1 | sort -u > ./portsdirs
        $ < ./portsdirs xargs -n1 make show=HOMEPAGE -C
        https://github.com/peha/
        https://github.com/espressif/arduino-esp32
        https://github.com/esp8266/Arduino
        https://github.com/semarie/cargo-generate-vendor
        https://github.com/harfbuzz/harfbuzz
        https://github.com/microsoft/cascadia-code
        https://github.com/alif-type/mada
        https://github.com/jazztickets/irrlamb
        https://github.com/mypaint/mypaint-brushes
        https://github.com/mypaint/mypaint-brushes
        https://github.com/ocaml/graphics
        https://github.com/resurrecting-open-source-projects/scrot
        https://github.com/nicm/fdm
        https://github.com/gonzalo-/openbsd-distfiles
        https://github.com/hanslub42/rlwrap
        https://github.com/samhocevar/zzuf
        https://github.com/mltframework/webvfx
        https://github.com/fobser/gelatod
        https://github.com/grayed/oicb
        https://github.com/majn/telegram-purple
        https://github.com/OpenPrinting/system-config-printer
        https://github.com/t-brown/mcds
        https://github.com/RUB-NDS/TLS-Attacker
        https://github.com/NixOS/patchelf
        https://github.com/garrigue/lablgtk

We can now bump REVISION for all ports and commit it together with the
bsd.port.mk diff setting HOMEPAGE for them:

        $ portbump -r $(< ./portsdirs)

Feedback? Objections? OK?

        $ cvs diff infrastructure/mk/bsd.port.mk $(< ./portsdirs)


Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1563
diff -u -p -r1.1563 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       27 Nov 2021 16:46:13 -0000      1.1563
+++ infrastructure/mk/bsd.port.mk       28 Nov 2021 15:31:24 -0000
@@ -1252,6 +1252,14 @@ 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
Index: archivers/deco/Makefile
===================================================================
RCS file: /cvs/ports/archivers/deco/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- archivers/deco/Makefile     23 Mar 2020 19:17:38 -0000      1.15
+++ archivers/deco/Makefile     7 Dec 2021 21:27:14 -0000
@@ -5,7 +5,7 @@ COMMENT=        extract various archive file fo
 V=             1.6.4
 ARCHIVE_V=     1.7
 PKGNAME=       deco-archive-${V}
-REVISION=      0
+REVISION=      1
 
 CATEGORIES=    archivers
 
Index: devel/arduino-esp32/Makefile
===================================================================
RCS file: /cvs/ports/devel/arduino-esp32/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- devel/arduino-esp32/Makefile        18 Nov 2021 16:03:23 -0000      1.7
+++ devel/arduino-esp32/Makefile        7 Dec 2021 21:27:12 -0000
@@ -4,6 +4,7 @@ COMMENT =       esp32 arduino core toolset
 V =            2.0.1
 DISTNAME =     esp32-${V}
 PKGNAME =      arduino-${DISTNAME}
+REVISION =     0
 
 CATEGORIES =   devel
 
Index: devel/arduino-esp8266/Makefile
===================================================================
RCS file: /cvs/ports/devel/arduino-esp8266/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- devel/arduino-esp8266/Makefile      2 Nov 2021 00:00:23 -0000       1.9
+++ devel/arduino-esp8266/Makefile      7 Dec 2021 21:27:13 -0000
@@ -4,7 +4,7 @@ COMMENT =       esp8266 arduino core toolset
 V =            3.0.2
 DISTNAME =     esp8266-${V}
 PKGNAME =      arduino-${DISTNAME}
-REVISION =     0
+REVISION =     1
 
 CATEGORIES =   devel
 
Index: devel/cargo-generate-vendor/Makefile
===================================================================
RCS file: /cvs/ports/devel/cargo-generate-vendor/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- devel/cargo-generate-vendor/Makefile        12 Jul 2019 20:44:05 -0000      
1.3
+++ devel/cargo-generate-vendor/Makefile        7 Dec 2021 21:27:12 -0000
@@ -4,7 +4,7 @@ COMMENT =       help generating metadata for c
 
 V =            1.0
 DISTNAME =     cargo-generate-vendor-${V}
-REVISION =     0
+REVISION =     1
 
 CATEGORIES =   devel
 
Index: devel/harfbuzz/Makefile
===================================================================
RCS file: /cvs/ports/devel/harfbuzz/Makefile,v
retrieving revision 1.138
diff -u -p -r1.138 Makefile
--- devel/harfbuzz/Makefile     27 Nov 2021 10:00:48 -0000      1.138
+++ devel/harfbuzz/Makefile     7 Dec 2021 21:27:14 -0000
@@ -4,6 +4,8 @@ BROKEN-hppa=            no atomic primitives
 
 COMMENT-main=          text shaping library
 COMMENT-icu=           ICU support for libharfbuzz
+REVISION-icu=          0
+REVISION-main=         0
 
 V=                     3.1.2
 DISTNAME=              harfbuzz-${V}
Index: fonts/cascadia-code/Makefile
===================================================================
RCS file: /cvs/ports/fonts/cascadia-code/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- fonts/cascadia-code/Makefile        17 Nov 2021 10:29:26 -0000      1.8
+++ fonts/cascadia-code/Makefile        7 Dec 2021 21:27:14 -0000
@@ -6,6 +6,7 @@ DISTNAME =      CascadiaCode-${V}
 PKGNAME =      cascadia-code-${V}
 EXTRACT_SUFX = .zip
 CATEGORIES =   fonts x11
+REVISION =     0
 
 # SIL OFL 1.1
 PERMIT_PACKAGE =       Yes
Index: fonts/mada/Makefile
===================================================================
RCS file: /cvs/ports/fonts/mada/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- fonts/mada/Makefile 12 Jul 2019 20:46:12 -0000      1.2
+++ fonts/mada/Makefile 7 Dec 2021 21:27:11 -0000
@@ -4,6 +4,7 @@ COMMENT =       modernist Arabic typeface
 
 V =            1.3
 DISTNAME =     mada-${V}
+REVISION =     0
 
 CATEGORIES =   fonts
 
Index: games/irrlamb/Makefile
===================================================================
RCS file: /cvs/ports/games/irrlamb/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- games/irrlamb/Makefile      12 Jul 2019 20:46:19 -0000      1.12
+++ games/irrlamb/Makefile      7 Dec 2021 21:27:15 -0000
@@ -5,7 +5,7 @@ COMMENT =       third person, 3D physics game
 DISTNAME =     irrlamb-$V-src
 PKGNAME =      irrlamb-$V
 CATEGORIES =   games x11
-REVISION =     2
+REVISION =     3
 
 # GPLv3+
 PERMIT_PACKAGE =               Yes
Index: graphics/mypaint-brushes/Makefile
===================================================================
RCS file: /cvs/ports/graphics/mypaint-brushes/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- graphics/mypaint-brushes/Makefile   18 May 2020 14:48:05 -0000      1.5
+++ graphics/mypaint-brushes/Makefile   7 Dec 2021 21:27:13 -0000
@@ -6,6 +6,7 @@ COMMENT =       brushes used by software using
 V =            1.3.1
 DISTNAME =     mypaint-brushes-$V
 EXTRACT_SUFX = .tar.xz
+REVISION =     0
 
 CATEGORIES =   graphics
 
Index: graphics/mypaint-brushes2/Makefile
===================================================================
RCS file: /cvs/ports/graphics/mypaint-brushes2/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- graphics/mypaint-brushes2/Makefile  12 Sep 2020 20:33:11 -0000      1.1.1.1
+++ graphics/mypaint-brushes2/Makefile  7 Dec 2021 21:27:14 -0000
@@ -6,6 +6,7 @@ V =             2.0.2
 DISTNAME =     mypaint-brushes-$V
 PKGNAME =      mypaint-brushes2-$V
 EXTRACT_SUFX = .tar.xz
+REVISION =     0
 
 CATEGORIES =   graphics
 
Index: graphics/ocaml-graphics/Makefile
===================================================================
RCS file: /cvs/ports/graphics/ocaml-graphics/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- graphics/ocaml-graphics/Makefile    2 Dec 2021 03:59:20 -0000       1.3
+++ graphics/ocaml-graphics/Makefile    7 Dec 2021 21:27:15 -0000
@@ -4,7 +4,7 @@ COMMENT =       graphics library providing bas
 CATEGORIES =   graphics
 
 V =            5.0.0
-REVISION =     1
+REVISION =     2
 DISTNAME =     graphics-$V
 PKGNAME =      ocaml-graphics-$V
 
Index: graphics/scrot/Makefile
===================================================================
RCS file: /cvs/ports/graphics/scrot/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- graphics/scrot/Makefile     29 Aug 2021 10:39:39 -0000      1.19
+++ graphics/scrot/Makefile     7 Dec 2021 21:27:15 -0000
@@ -4,6 +4,7 @@ COMMENT=                commandline screen capture uti
 
 V=                     1.6
 DISTNAME=              scrot-${V}
+REVISION=              0
 
 CATEGORIES=            graphics
 
Index: mail/fdm/Makefile
===================================================================
RCS file: /cvs/ports/mail/fdm/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- mail/fdm/Makefile   23 Jan 2021 23:17:48 -0000      1.25
+++ mail/fdm/Makefile   7 Dec 2021 21:27:13 -0000
@@ -5,7 +5,7 @@ COMMENT=        fetch, filter and deliver mail
 V=             2.0
 DISTNAME=      fdm-$V
 CATEGORIES=    mail
-REVISION=      1
+REVISION=      2
 
 MAINTAINER=    Nicholas Marriott <n...@openbsd.org>
 
Index: mail/greyscanner/Makefile
===================================================================
RCS file: /cvs/ports/mail/greyscanner/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- mail/greyscanner/Makefile   30 Nov 2020 15:41:56 -0000      1.15
+++ mail/greyscanner/Makefile   7 Dec 2021 21:27:14 -0000
@@ -4,7 +4,7 @@ COMMENT =       greytrapping daemon to complem
 
 DISTNAME =     greyscanner-2.01
 CATEGORIES =   mail
-REVISION =     1
+REVISION =     2
 
 # BSD
 PERMIT_PACKAGE =       Yes
Index: misc/rlwrap/Makefile
===================================================================
RCS file: /cvs/ports/misc/rlwrap/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- misc/rlwrap/Makefile        12 Nov 2021 14:33:04 -0000      1.15
+++ misc/rlwrap/Makefile        7 Dec 2021 21:27:13 -0000
@@ -5,6 +5,7 @@ COMMENT=                generic readline wrapper for v
 V =                    0.45.2
 DISTNAME=              rlwrap-$V
 CATEGORIES=            misc
+REVISION=              0
 
 # GPLv2
 PERMIT_PACKAGE=        Yes
Index: misc/zzuf/Makefile
===================================================================
RCS file: /cvs/ports/misc/zzuf/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- misc/zzuf/Makefile  12 Jul 2019 20:47:55 -0000      1.20
+++ misc/zzuf/Makefile  7 Dec 2021 21:27:12 -0000
@@ -6,6 +6,7 @@ COMMENT=                transparent application input 
 
 VERSION=               0.15
 DISTNAME=              zzuf-${VERSION}
+REVISION=              0
 
 CATEGORIES=            misc security
 
Index: multimedia/webvfx/Makefile
===================================================================
RCS file: /cvs/ports/multimedia/webvfx/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- multimedia/webvfx/Makefile  20 May 2020 15:16:26 -0000      1.2
+++ multimedia/webvfx/Makefile  7 Dec 2021 21:27:13 -0000
@@ -6,6 +6,7 @@ COMMENT =       video effects library
 V =            1.2.0
 DISTNAME =     webvfx-$V
 DISTFILES =    webvfx-{}$V${EXTRACT_SUFX}
+REVISION =     0
 
 SHARED_LIBS +=  webvfx                    0.0 # 1.2
 
Index: net/gelatod/Makefile
===================================================================
RCS file: /cvs/ports/net/gelatod/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- net/gelatod/Makefile        23 Nov 2021 23:48:05 -0000      1.3
+++ net/gelatod/Makefile        7 Dec 2021 21:27:11 -0000
@@ -4,6 +4,7 @@ COMMENT =               CLAT configuration daemon for
 V =                    1.3
 DISTNAME =             gelatod-${V}
 CATEGORIES =           net
+REVISION =             0
 
 # BSD 2-clause
 PERMIT_PACKAGE =       Yes
Index: net/oicb/Makefile
===================================================================
RCS file: /cvs/ports/net/oicb/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- net/oicb/Makefile   6 Mar 2021 23:08:16 -0000       1.10
+++ net/oicb/Makefile   7 Dec 2021 21:27:12 -0000
@@ -4,6 +4,7 @@ VERSION =       1.3.0
 DISTNAME =     oicb-${VERSION}
 CATEGORIES =   net
 MAINTAINER =   Vadim Zhukov <z...@openbsd.org>
+REVISION =     0
 
 # 2-clause BSD
 PERMIT_PACKAGE =       Yes
Index: net/telegram-purple/Makefile
===================================================================
RCS file: /cvs/ports/net/telegram-purple/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- net/telegram-purple/Makefile        4 Jan 2021 11:56:28 -0000       1.8
+++ net/telegram-purple/Makefile        7 Dec 2021 21:27:15 -0000
@@ -8,6 +8,7 @@ COMMENT =               Telegram support for Pidgin
 DISTNAME =             telegram-purple_$V.orig
 PKGNAME =              telegram-purple-$V
 CATEGORIES =           net
+REVISION =             0
 
 # GPLv2+
 PERMIT_PACKAGE =       Yes
Index: print/system-config-printer/Makefile
===================================================================
RCS file: /cvs/ports/print/system-config-printer/Makefile,v
retrieving revision 1.62
diff -u -p -r1.62 Makefile
--- print/system-config-printer/Makefile        2 Nov 2021 00:01:54 -0000       
1.62
+++ print/system-config-printer/Makefile        7 Dec 2021 21:27:12 -0000
@@ -4,7 +4,7 @@ COMMENT=                printer (CUPS) administration 
 
 V=                     1.5.15
 DISTNAME=              system-config-printer-${V}
-REVISION=              0
+REVISION=              1
 
 CATEGORIES=            print sysutils
 
Index: productivity/mcds/Makefile
===================================================================
RCS file: /cvs/ports/productivity/mcds/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- productivity/mcds/Makefile  5 Oct 2020 19:46:17 -0000       1.7
+++ productivity/mcds/Makefile  7 Dec 2021 21:27:15 -0000
@@ -5,7 +5,7 @@ COMMENT =               tty-based CardDav search tool
 V =                    1.6
 DISTNAME =             mcds-${V}
 CATEGORIES =           productivity
-REVISION =             1
+REVISION =             2
 
 MAINTAINER =           Timothy Brown <tbr...@freeshell.org>
 
Index: security/tls-attacker/Makefile
===================================================================
RCS file: /cvs/ports/security/tls-attacker/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- security/tls-attacker/Makefile      19 May 2021 01:50:31 -0000      1.2
+++ security/tls-attacker/Makefile      7 Dec 2021 21:27:13 -0000
@@ -5,7 +5,7 @@ COMMENT =               framework for analyzing TLS l
 V =                    3.5.0
 DISTNAME =             TLS-Attacker-$V
 PKGNAME =              ${DISTNAME:L}
-REVISION =             0
+REVISION =             1
 
 MAINTAINER =           Jasper Lievisse Adriaanse <jas...@openbsd.org>
 
Index: sysutils/patchelf/Makefile
===================================================================
RCS file: /cvs/ports/sysutils/patchelf/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- sysutils/patchelf/Makefile  6 Dec 2021 19:26:45 -0000       1.8
+++ sysutils/patchelf/Makefile  7 Dec 2021 21:27:13 -0000
@@ -5,6 +5,7 @@ COMMENT =       utility for modifying existing
 V =                    0.14.3
 DISTNAME =             patchelf-${V}
 MASTER_SITES =         
https://github.com/NixOS/patchelf/releases/download/${V}/
+REVISION =             0
 
 CATEGORIES =           sysutils
 
Index: x11/lablgtk3/Makefile
===================================================================
RCS file: /cvs/ports/x11/lablgtk3/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- x11/lablgtk3/Makefile       5 Dec 2021 13:28:56 -0000       1.9
+++ x11/lablgtk3/Makefile       7 Dec 2021 21:27:12 -0000
@@ -5,7 +5,7 @@ CATEGORIES =    x11 devel
 
 V =            3.1.1
 DISTNAME =     lablgtk3-${V}
-REVISION =     2
+REVISION =     3
 
 MASTER_SITES = https://github.com/garrigue/lablgtk/releases/download/${V}/
 EXTRACT_SUFX = .tbz

Reply via email to