sys-apps/plocate: add cron and timers for updatedb

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
This commit is contained in:
Arsen Arsenović
2021-03-03 22:50:44 +01:00
parent bc1fb652f1
commit 2aaa3ab640
4 changed files with 35 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/sbin/updatedb

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Update the plocate database
ConditionACPower=true
[Service]
Type=oneshot
ExecStart=/usr/sbin/updatedb
LimitNOFILE=131072
IOSchedulingClass=idle
PrivateTmp=true
PrivateDevices=true
PrivateNetwork=true

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Update the plocate database daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target

View File

@@ -3,7 +3,7 @@
EAPI=7
inherit meson
inherit meson systemd
if [[ "${PV}" == "9999" ]]; then
inherit git-r3
@@ -27,10 +27,18 @@ DEPEND="
src_configure() {
local emesonargs=(
-Dinstall_cron=true
-Dinstall_systemd=true
-Dinstall_cron=false
-Dinstall_systemd=false
-Dlocategroup=locate
)
meson_src_configure
}
src_install() {
meson_src_install
exeinto /etc/cron.daily/
newexe "${FILESDIR}"/updatedb.cron plocate
systemd_dounit "${FILESDIR}"/updatedb.{service,timer}
}