On Thu, Apr 20, 2023 at 02:25:35PM +0200, Landry Breuil wrote:
> yes it is but for complicated cases "make update" cant work iirc. You
> need to update both packages (gitwrapper and git) altogether for it to
> work.
> 
> have you tried pointing pkg_add -u at /usr/ports/packages/amd64/all via
> TRUSTED_PKG_PATH (dont remember the exact magic)

sthen@ helped me solve the remaining issue. The fix is to use
@conflict git-<2.40.0p0 instead of @conflict git-<=2.40.0 (which
seems to match any pX revision marker).

This version upgrades fine: git-2.40.0->git-2.40.0p0+gitwrapper-0.87: ok

Quick test, without having gotd running:

$ git init foo.git
Initialized empty Git repository in /tmp/foo.git/.git/
$ git clone ssh://localhost//tmp/foo.git foo2
Cloning into 'foo2'...
warning: You appear to have cloned an empty repository.
$ cat /etc/gotd.conf
user stsp
repository "test" {
        path "/tmp/test.git"
        permit rw stsp
}
$ gotadmin init /tmp/test.git
gotadmin: directory exists and is not empty
$ git clone ssh://localhost/test test1
Cloning into 'test1'...
git-upload-pack: connect: /var/run/gotd.sock: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$

Second clone fails as expected since gotd is not running. The point is
that gitwrapper (started as git-upload-pack) ends up launching gotsh(1) for
/tmp/test.git. Whereas the real git-upload-pack, which is still present in
the directory /usr/local/libexec/git/, was launched for /tmp/foo.git.

ok?

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 <s...@openbsd.org>
@@ -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.0p0
+bin/git-receive-pack
+bin/git-upload-pack
+@bin bin/gitwrapper
+@man man/man1/gitwrapper.1

Reply via email to