summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Qian <i@bitbili.net>2023-11-17 20:22:18 +0800
committerYixun Lan <dlan@gentoo.org>2023-11-21 14:27:00 +0000
commit7fb39ef76095d92e575957a40533ef0ada3e68c7 (patch)
tree7c3a938a00a896004b009414abc18899dab88092 /www-apps
parentdev-python/jupyter-console: Enable pypy3 (diff)
downloadgentoo-7fb39ef76095d92e575957a40533ef0ada3e68c7.tar.gz
gentoo-7fb39ef76095d92e575957a40533ef0ada3e68c7.tar.bz2
gentoo-7fb39ef76095d92e575957a40533ef0ada3e68c7.zip
www-apps/gitea: fix the execution logic of 'tmpfiles_process'
It is not guaranteed that the git user and group always exist (due to the acct USE Flag), but for convenience, the tmpfile uses the git user and group by default. To avoid installation errors, a condition needs to be added here: if there is no git user or group, the installation of tmpfile will be skipped and the user will be notified to handle it by themselves. This commit won't affect the already installed gitea, so no new revision. Closes: https://bugs.gentoo.org/829761 Closes: https://bugs.gentoo.org/858668 Closes: https://github.com/gentoo/gentoo/pull/33867 Signed-off-by: Ryan Qian <i@bitbili.net> Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/gitea/gitea-1.20.4.ebuild21
-rw-r--r--www-apps/gitea/gitea-1.20.5.ebuild21
-rw-r--r--www-apps/gitea/gitea-1.21.0.ebuild21
3 files changed, 57 insertions, 6 deletions
diff --git a/www-apps/gitea/gitea-1.20.4.ebuild b/www-apps/gitea/gitea-1.20.4.ebuild
index d9f75b9674ad..528d3b3a10f7 100644
--- a/www-apps/gitea/gitea-1.20.4.ebuild
+++ b/www-apps/gitea/gitea-1.20.4.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit fcaps go-module tmpfiles systemd flag-o-matic
+inherit fcaps go-module tmpfiles systemd flag-o-matic user-info
DESCRIPTION="A painless self-hosted Git service"
HOMEPAGE="https://gitea.com https://github.com/go-gitea/gitea"
@@ -105,7 +105,24 @@ src_install() {
pkg_postinst() {
fcaps_pkg_postinst
- tmpfiles_process gitea.conf
+
+ # It is not guaranteed that the git user and group always exist (due to the acct USE Flag),
+ # but for convenience, the tmpfile uses the git user and group by default.
+ # To avoid installation errors, a condition needs to be added here:
+ # if there is no git user or group, the installation of tmpfile will be skipped
+ # and the user will be notified to handle it by themselves.
+ if egetent passwd git &>/dev/null && \
+ egetent group git &>/dev/null; then
+ tmpfiles_process gitea.conf
+ else
+ eerror "Unable to install the tmpfile for gitea due to the git user or group is missing,"
+ eerror "please install tmpfile manually or rebuild this package with USE flag 'acct'."
+ eerror "You can simply copy the default tmpfile from '/usr/lib/tmpfiles.d/gitea.conf'"
+ eerror "to higher priority path '/etc/tmpfiles.d/gitea.conf', and correct it with"
+ eerror "the right User and Group value (see tmpfiles.d(5) for details), then execute:"
+ eerror " # systemd-tmpfiles --create /etc/tmpfiles.d/gitea.conf"
+ eerror "to install it."
+ fi
ewarn "The default JWT signing algorithm changed in 1.15.0 from HS256 (symmetric) to"
ewarn "RS256 (asymmetric). Gitea OAuth2 tokens (and potentially client secrets) will"
diff --git a/www-apps/gitea/gitea-1.20.5.ebuild b/www-apps/gitea/gitea-1.20.5.ebuild
index 916258630180..907a990c4862 100644
--- a/www-apps/gitea/gitea-1.20.5.ebuild
+++ b/www-apps/gitea/gitea-1.20.5.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit fcaps go-module tmpfiles systemd flag-o-matic
+inherit fcaps go-module tmpfiles systemd flag-o-matic user-info
DESCRIPTION="A painless self-hosted Git service"
HOMEPAGE="https://gitea.com https://github.com/go-gitea/gitea"
@@ -105,7 +105,24 @@ src_install() {
pkg_postinst() {
fcaps_pkg_postinst
- tmpfiles_process gitea.conf
+
+ # It is not guaranteed that the git user and group always exist (due to the acct USE Flag),
+ # but for convenience, the tmpfile uses the git user and group by default.
+ # To avoid installation errors, a condition needs to be added here:
+ # if there is no git user or group, the installation of tmpfile will be skipped
+ # and the user will be notified to handle it by themselves.
+ if egetent passwd git &>/dev/null && \
+ egetent group git &>/dev/null; then
+ tmpfiles_process gitea.conf
+ else
+ eerror "Unable to install the tmpfile for gitea due to the git user or group is missing,"
+ eerror "please install tmpfile manually or rebuild this package with USE flag 'acct'."
+ eerror "You can simply copy the default tmpfile from '/usr/lib/tmpfiles.d/gitea.conf'"
+ eerror "to higher priority path '/etc/tmpfiles.d/gitea.conf', and correct it with"
+ eerror "the right User and Group value (see tmpfiles.d(5) for details), then execute:"
+ eerror " # systemd-tmpfiles --create /etc/tmpfiles.d/gitea.conf"
+ eerror "to install it."
+ fi
ewarn "The default JWT signing algorithm changed in 1.15.0 from HS256 (symmetric) to"
ewarn "RS256 (asymmetric). Gitea OAuth2 tokens (and potentially client secrets) will"
diff --git a/www-apps/gitea/gitea-1.21.0.ebuild b/www-apps/gitea/gitea-1.21.0.ebuild
index fce72a8ba35f..15ca9f045d07 100644
--- a/www-apps/gitea/gitea-1.21.0.ebuild
+++ b/www-apps/gitea/gitea-1.21.0.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit fcaps go-module tmpfiles systemd flag-o-matic
+inherit fcaps go-module tmpfiles systemd flag-o-matic user-info
DESCRIPTION="A painless self-hosted Git service"
HOMEPAGE="https://gitea.com https://github.com/go-gitea/gitea"
@@ -117,7 +117,24 @@ src_install() {
pkg_postinst() {
fcaps_pkg_postinst
- tmpfiles_process gitea.conf
+
+ # It is not guaranteed that the git user and group always exist (due to the acct USE Flag),
+ # but for convenience, the tmpfile uses the git user and group by default.
+ # To avoid installation errors, a condition needs to be added here:
+ # if there is no git user or group, the installation of tmpfile will be skipped
+ # and the user will be notified to handle it by themselves.
+ if egetent passwd git &>/dev/null && \
+ egetent group git &>/dev/null; then
+ tmpfiles_process gitea.conf
+ else
+ eerror "Unable to install the tmpfile for gitea due to the git user or group is missing,"
+ eerror "please install tmpfile manually or rebuild this package with USE flag 'acct'."
+ eerror "You can simply copy the default tmpfile from '/usr/lib/tmpfiles.d/gitea.conf'"
+ eerror "to higher priority path '/etc/tmpfiles.d/gitea.conf', and correct it with"
+ eerror "the right User and Group value (see tmpfiles.d(5) for details), then execute:"
+ eerror " # systemd-tmpfiles --create /etc/tmpfiles.d/gitea.conf"
+ eerror "to install it."
+ fi
ewarn "Since 1.21.0:"
ewarn " 1. The built-in SSH server will now only accept SSH user"