Pavel Korovin wrote (2023-01-09 12:53 WET): > On 01/09, Stefan Hagen wrote: > > /var/gitea# fgrep -r 'env bash' . > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/pre-receive.d/gitea:#!/usr/bin/env > > bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/pre-receive:#!/usr/bin/env > > bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/update.d/gitea:#!/usr/bin/env > > bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/update:#!/usr/bin/env bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/post-receive.d/gitea:#!/usr/bin/env > > bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/post-receive:#!/usr/bin/env > > bash > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/proc-receive:#!/usr/bin/env > > bash > > [same for all other repositories on the server] > > > > /var/gitea# cat > > ./data/gitea-repositories/sdk/dotfiles.git/hooks/pre-receive.d/gitea > > #!/usr/bin/env bash > > # AUTO GENERATED BY GITEA, DO NOT MODIFY > > /usr/local/sbin/gitea hook --config=/etc/gitea/app.ini pre-receive > > > > So I still think adding bash is necessary for an out of the box > > installation. > > My setups work fine without bash. > # grep SCRIPT_TYPE /etc/gitea/app.ini > SCRIPT_TYPE = sh > > What's in your SCRIPT_TYPE var?
Same, but I figured it out! After installing gitea, the app.ini looks like this: [...] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;[repository] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories. ;; A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT) ROOT = /var/gitea/gitea-repositories ;; ;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. SCRIPT_TYPE = sh [...] The problematic part is, that "[repository]" is still commented. This means SCRIPT_TYPE is in "[service]" (previous open section) and has no effect. So what we actually need is not bash, but something like the sed in do-install below. Best Regards, Stefan Index: www/gitea/Makefile =================================================================== RCS file: /cvs/ports/www/gitea/Makefile,v retrieving revision 1.87 diff -u -p -u -p -r1.87 Makefile --- www/gitea/Makefile 8 Jan 2023 09:21:31 -0000 1.87 +++ www/gitea/Makefile 9 Jan 2023 17:12:28 -0000 @@ -3,7 +3,7 @@ COMMENT = compact self-hosted Git servi VERSION = 1.17.4 DISTNAME = gitea-src-${VERSION} PKGNAME = gitea-${VERSION} -REVISION = 0 +REVISION = 1 MASTER_SITES = https://github.com/go-gitea/gitea/releases/download/v${VERSION}/ @@ -28,8 +28,7 @@ MODGO_LDFLAGS += -X code.gitea.io/gitea/ MODGO_LDFLAGS += -X main.Version=${VERSION} MODGO_LDFLAGS += -X 'main.Tags=${GO_TAGS}' -RUN_DEPENDS = devel/git \ - shells/bash +RUN_DEPENDS = devel/git ALL_TARGET = code.gitea.io/gitea WRKSRC = ${MODGO_WORKSPACE}/src/${ALL_TARGET} @@ -46,6 +45,7 @@ do-install: ${INSTALL_DATA_DIR} ${WRKINST}${VARBASE}/www/gitea cp -Rp ${WRKSRC}/public ${WRKINST}${VARBASE}/www/gitea ln -s ${VARBASE}/www/gitea/public ${PREFIX}/share/gitea/public + sed -i 's/^;\[repository\]$$/[repository]/g' ${PREFIX}/share/gitea/conf/app.example.ini post-install: @find ${WRKINST}/ -type f \