mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-10 15:45:15 -04:00
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:
2
sys-apps/plocate/files/updatedb.cron
Normal file
2
sys-apps/plocate/files/updatedb.cron
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/updatedb
|
||||
13
sys-apps/plocate/files/updatedb.service
Normal file
13
sys-apps/plocate/files/updatedb.service
Normal 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
|
||||
9
sys-apps/plocate/files/updatedb.timer
Normal file
9
sys-apps/plocate/files/updatedb.timer
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Update the plocate database daily
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user