New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
www-apps/cgit: Create cache directory at runtime #30724
Conversation
Pull Request assignmentSubmitter: @cjmayo www-apps/cgit: @gentoo/web-apps Linked bugsBugs linked: 516388 In order to force reassignment and/or bug reference scan, please append Docs: Code of Conduct ● Copyright policy (expl.) ● Devmanual ● GitHub PRs ● Proxy-maint guide |
Why doesn't this fix the issue for non-systemd systems? (What am I missing?) |
I assumed tmpfiles wasn't supported by openrc. Looking into it there is: sys-apps/opentmpfiles-0.2-r1, but:
|
Pull request CI reportReport generated at: 2023-04-23 19:28 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
OK sys-apps/systemd-tmpfiles is the replacement which doesn't need systemd. I will update this PR. |
Closes: https://bugs.gentoo.org/516388 Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Updated to use tmpfiles for everyone:
--- cgit-1.2.3-r201.ebuild
+++ cgit-1.2.3-r202.ebuild
@@ -9,7 +9,7 @@
WEBAPP_MANUAL_SLOT="yes"
-inherit lua-single python-single-r1 toolchain-funcs webapp
+inherit lua-single python-single-r1 tmpfiles toolchain-funcs webapp
[[ -z "${CGIT_CACHEDIR}" ]] && CGIT_CACHEDIR="/var/cache/${PN}/"
@@ -22,7 +22,7 @@
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 arm ~riscv x86"
+KEYWORDS="~amd64 ~arm ~riscv ~x86"
IUSE="doc +highlight +lua test"
REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} ) ${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"
@@ -91,9 +91,11 @@
webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
webapp_src_install
- keepdir "${CGIT_CACHEDIR}"
- fowners ${PN}:${PN} "${CGIT_CACHEDIR}"
- fperms 700 "${CGIT_CACHEDIR}"
+ cat > cgit.conf <<-EOT || die
+ d ${CGIT_CACHEDIR} 0700 cgit cgit -
+ EOT
+ dotmpfiles cgit.conf
+
python_fix_shebang .
}
@@ -103,6 +105,11 @@
pkg_postinst() {
webapp_pkg_postinst
- ewarn "If you intend to run cgit using web server's user"
- ewarn "you should change ${CGIT_CACHEDIR} permissions."
+ tmpfiles_process cgit.conf
+ ewarn "The cgit cache is enabled using the cache-size setting in cgitrc."
+ ewarn "If enabling the cache and running cgit using the web server's user"
+ ewarn "you should copy /usr/lib/tmpfiles.d/cgit.conf"
+ ewarn "to /etc/tmpfiles.d/ and edit, changing the ownership fields."
+ ewarn "If you use the cache-root setting in cgitrc to specify a cache directory"
+ ewarn "other than ${CGIT_CACHEDIR} edit the path in cgit.conf."
} |
Pull request CI reportReport generated at: 2023-04-24 18:38 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
Closes: https://bugs.gentoo.org/516388
Add a systemd USE flag because this does not fix the problem for non-systemd systems.