On Thu, Apr 20, 2023 at 07:14:39AM +0200, Landry Breuil wrote:
> Le Wed, Apr 19, 2023 at 11:56:21PM +0200, Stefan Sperling a écrit :
> > A new release of got introduces gitwrapper which makes it much
> > easier to run gotd side-by-side with regular Git binaries.
> > Essentially, clients fetching repositories over ssh will be talking to
> > gotd if the repository is listed in /etc/gotd.conf. Otherwise they
> > will be talking to regular Git. (Unless the user account has gotsh
> > set as login shell, which will always talk to gotd.)
> > 
> > For this to work, gitwrapper must replace two specific binaries in
> > the git package with symlinks to itself. I am trying to make this
> > work seemlessly during upgrades from got-0.86 and git-2.40.0.
> > 
> > When I install the git package from the ports tree with:
> >     make install SUDO=doas
> > this does not install the gitwrapper package from devel/got and the
> > files end up missing from disk. Can anyone tell what am I doing wrong?
> > I would hope the RUN_DEPENDS I've added would take care of this?
> 
> I think the RDEP should be devel/got,-gitwrapper to install the
> -gitwrapper subpackage, devel/got,gitwrapper asks for the gitwrapper
> FLAVOR of the got port (which doesnt exist)

Ah, thanks! I missed that difference.

And I need to add gitwrapper to RUN_DEPENDS-main instead of RUN_DEPENDS.

I am now adding gitwrapper as a run-dep for gotd as well.

This gets me further but 'make install' and 'make upgrade' fail,
even though gitwrapper is built as a package locally.

Is this supposed to work?

$ pwd
/usr/ports/devel/git
$ make install SUDO=doas
===> git-2.40.0p0 depends on: gitwrapper-* - not found
===>  Verifying install for gitwrapper-* in devel/got
===>  Cleaning for gitwrapper-0.87
===> gitwrapper-0.87 depends on: dwz-* -> dwz-0.14
===>  Verifying specs: c
===>  found c.97.0
===>  Installing gitwrapper-0.87 from /usr/ports/packages/amd64/all/
Can't install gitwrapper-0.87 because of conflicts (git-2.40.0)
--- gitwrapper-0.87 -------------------
Can't install gitwrapper-0.87: conflicts
Couldn't install gitwrapper-0.87
*** Error 1 in /usr/ports/devel/got 
(/usr/ports/infrastructure/mk/bsd.port.mk:2157 
'/var/db/pkg/gitwrapper-0.87/+CONTENTS': @/usr/bin/env -i...)
*** Error 2 in /usr/ports/devel/got 
(/usr/ports/infrastructure/mk/bsd.port.mk:2600 'install': @lock=got-0.87;  
export _LOCKS_HELD=" git-2.40...)
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2282 
'/usr/ports/pobj/git-2.40.0/.dep-devel-got,-gitwrapper': @unset _DEPENDS_TAR...)
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2155 
'/var/db/pkg/git-2.40.0p0/+CONTENTS': @cd /usr/ports/devel/git && SUBPACKAGE...)
*** Error 2 in /usr/ports/devel/git 
(/usr/ports/infrastructure/mk/bsd.port.mk:2600 'install': @lock=git-2.40.0;  
export _LOCKS_HELD=" git-2....)

$ make update SUDO=doas
===> Updating for git-2.40.0p0
===> git-2.40.0p0 depends on: gitwrapper-* - not found
===>  Verifying package for gitwrapper-* in devel/got
`/usr/ports/bulk/amd64/got-0.87' is up to date.
===> Returning to build of git-2.40.0p0
Upgrading from git-2.40.0
git-2.40.0->gitwrapper-0.87 forward dependencies:
| Dependency of thunar-vcs-0.2.0p4 on git-* doesn't match
NOT MERGING: can't find update for thunar-vcs-0.2.0p4-> (ok)
Can't install git-2.40.0->2.40.0p0: can't resolve gitwrapper-0.87
Couldn't find updates for git-2.40.0 thunar-vcs-0.2.0p4
Couldn't install git-2.40.0p0 gitwrapper-0.87
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2169 
'/usr/ports/update/amd64/git-2.40.0p0': @b=$(cd /usr/ports/devel/git && SUBP...)
*** Error 2 in /usr/ports/devel/git 
(/usr/ports/infrastructure/mk/bsd.port.mk:2600 'update': @lock=git-2.40.0;  
export _LOCKS_HELD=" git-2.4...)
$


diff /usr/ports
commit - 6e3c62131849d4c5d8f47e7e4e2d5d95fb0a263f
path + /usr/ports
blob - ddabef359f8634fd9bbf1bb3b9ca610794cad214
file + devel/git/Makefile
--- devel/git/Makefile
+++ devel/git/Makefile
@@ -3,6 +3,7 @@ DISTNAME =      git-${V}
 COMMENT-x11 =  graphical tools
 
 V =            2.40.0
+REVISION =     0
 DISTNAME =     git-${V}
 CATEGORIES =   devel
 
@@ -41,8 +42,10 @@ RUN_DEPENDS-main =   devel/cvsps \
 
 
 RUN_DEPENDS-main =     devel/cvsps \
+                       devel/got,-gitwrapper \
                        devel/p5-Error \
                        mail/p5-Mail-Tools
+
 LIB_DEPENDS-main =     devel/gettext,-runtime \
                        net/curl
 
@@ -137,5 +140,7 @@ post-install:
        perl -pi -e "s|${WRKINST}||g" ${PREFIX}/share/gitweb/gitweb.cgi
        ${INSTALL_DATA} ${WRKBUILD}/gitweb/README ${PREFIX}/share/gitweb
        ${MODTCL_WISH_ADJ} ${PREFIX}/libexec/git/git-gui--askpass
+       rm ${PREFIX}/bin/git-receive-pack       # handled by gitwrapper
+       rm ${PREFIX}/bin/git-upload-pack        # handled by gitwrapper
 
 .include <bsd.port.mk>
blob - ae0a7f1539223a157f78d388e6c358f9f4c8107b
file + devel/git/pkg/PLIST-main
--- devel/git/pkg/PLIST-main
+++ devel/git/pkg/PLIST-main
@@ -5,10 +5,8 @@ bin/git-cvsserver
 @rcscript ${RCDIR}/gitdaemon
 @bin bin/git
 bin/git-cvsserver
-@bin bin/git-receive-pack
 @shell bin/git-shell
 @bin bin/git-upload-archive
-@bin bin/git-upload-pack
 @bin bin/scalar
 @static-lib lib/libgit.a
 ${P5SITE}/Git/
blob - 84f229d487bb8f3fbf6d1b3a1f04693f75daaa3b
file + devel/got/Makefile
--- devel/got/Makefile
+++ devel/got/Makefile
@@ -1,11 +1,13 @@
 COMMENT-main =         game of trees version control system
 COMMENT-server =       game of trees repository server
 COMMENT-webd =         game of trees repository fast-cgi server
+COMMENT-gitwrapper =   invoke an appropriate Git repository server
 
-V =                    0.86
+V =                    0.87
 DISTNAME =             got-${V}
 PKGNAME-server =       gotd-${V}
 PKGNAME-webd =         gotwebd-${V}
+PKGNAME-gitwrapper =   gitwrapper-${V}
 CATEGORIES =           devel
 HOMEPAGE =             https://gameoftrees.org
 MAINTAINER =           Stefan Sperling <[email protected]>
@@ -13,12 +15,15 @@ MULTI_PACKAGES =    -main -server -webd
 # ISC
 PERMIT_PACKAGE =       Yes
 
-MULTI_PACKAGES =       -main -server -webd
+RUN_DEPENDS-server =   devel/got,-gitwrapper
 
+MULTI_PACKAGES =       -main -server -webd -gitwrapper
+
 # uses pledge()
 WANTLIB-main =         c curses m panel pthread util z
 WANTLIB-server =       c event m util z
 WANTLIB-webd =         c event m util z
+WANTLIB-gitwrapper =   c
 
 MAKE_FLAGS =           CC="${CC}"
 ALL_TARGET =           all server webd
@@ -38,4 +43,8 @@ FAKE_FLAGS =          MANDIR=${PREFIX}/man/man CHROOT_DIR=${VA
 TEST_TARGET =          regress
 FAKE_FLAGS =           MANDIR=${PREFIX}/man/man CHROOT_DIR=${VARBASE}/www
 
+post-install:
+       @ln -s gitwrapper ${PREFIX}/bin/git-upload-pack
+       @ln -s gitwrapper ${PREFIX}/bin/git-receive-pack
+
 .include <bsd.port.mk>
blob - e5e69b24f97535a28a03dea6989f19bd9fdd61f6
file + devel/got/distinfo
--- devel/got/distinfo
+++ devel/got/distinfo
@@ -1,2 +1,2 @@
-SHA256 (got-0.86.tar.gz) = JHOjr8U1bRmZ74/qf/P3PqZJGUYq34cQVCSw+jurh+w=
-SIZE (got-0.86.tar.gz) = 806708
+SHA256 (got-0.87.tar.gz) = dPi14M4RWMh3Yo4NlaQrjhzh/gr8L8AZEbpOpHGXhgU=
+SIZE (got-0.87.tar.gz) = 822791
blob - /dev/null
file + devel/got/pkg/DESCR-gitwrapper (mode 644)
--- /dev/null
+++ devel/got/pkg/DESCR-gitwrapper
@@ -0,0 +1,8 @@
+The gitwrapper program is designed to replace git-upload-pack(1) and
+git-receive-pack(1) and to invoke an appropriate Git server based on
+configuration information placed in gotd.conf(5).  This permits the
+administrator to configure which Git server is to be invoked on the
+system at run-time.  Git repositories which are listed in gotd.conf(5)
+and exist on the filesystem will be served by gotsh(1).  Any other Git
+repositories will be served by git-upload-pack(1) and
+git-receive-pack(1).
blob - /dev/null
file + devel/got/pkg/PLIST-gitwrapper (mode 644)
--- /dev/null
+++ devel/got/pkg/PLIST-gitwrapper
@@ -0,0 +1,5 @@
+@conflict git-<=2.40.0
+bin/git-receive-pack
+bin/git-upload-pack
+@bin bin/gitwrapper
+@man man/man1/gitwrapper.1

Reply via email to