summaryrefslogtreecommitdiff
path: root/sys-apps/plocate/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-20 14:27:17 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-20 14:27:17 +0000
commit5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (patch)
tree66e860a5099bcad013f1cf667255dc372a7c11b3 /sys-apps/plocate/files
parent7218e1b46bceac05841e90472501742d905fb3fc (diff)
gentoo resync : 20.03.2021
Diffstat (limited to 'sys-apps/plocate/files')
-rw-r--r--sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch21
-rw-r--r--sys-apps/plocate/files/plocate-cron.conf9
-rw-r--r--sys-apps/plocate/files/plocate.cron51
-rw-r--r--sys-apps/plocate/files/updatedb.conf16
4 files changed, 97 insertions, 0 deletions
diff --git a/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
new file mode 100644
index 000000000000..2635a8007882
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
@@ -0,0 +1,21 @@
+Unconditionally install systemd unit
+--- a/meson.build
++++ b/meson.build
+@@ -76,17 +76,9 @@
+ configuration: conf_data)
+ install_man(updatedb_conf_man)
+
+-if get_option('install_systemd')
+- systemd = dependency('systemd', required: false)
+- if systemd.found()
+- unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
+ output: 'plocate-updatedb.service',
+ configuration: conf_data)
+- install_data(updatedb_service, install_dir: unitdir)
+- install_data('plocate-updatedb.timer', install_dir: unitdir)
+- endif
+-endif
+
+ # Requires having TurboPFor checked out, so not built by default.
+ # Unless you have a recent Meson, there's no apparently good way
diff --git a/sys-apps/plocate/files/plocate-cron.conf b/sys-apps/plocate/files/plocate-cron.conf
new file mode 100644
index 000000000000..f207344a9e6c
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-cron.conf
@@ -0,0 +1,9 @@
+# nice value to run at: see -n in nice(1)
+NICE="19"
+
+# ionice class to run at: see -c in ionice(1)
+# you have to install sys-apps/util-linux manually
+IONICE_CLASS="2"
+
+# ionice priority to run at: see -n in ionice(1)
+IONICE_PRIORITY="7"
diff --git a/sys-apps/plocate/files/plocate.cron b/sys-apps/plocate/files/plocate.cron
new file mode 100644
index 000000000000..ebcfcbffe7b0
--- /dev/null
+++ b/sys-apps/plocate/files/plocate.cron
@@ -0,0 +1,51 @@
+#! /bin/sh
+set -e
+
+# check if we run on battery and if so then don't run
+if which on_ac_power >/dev/null 2>&1; then
+ ON_BATTERY=0
+ on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
+ if [ "${ON_BATTERY}" -eq 1 ]; then
+ exit 0
+ fi
+fi
+
+# check if we are already running (lockfile)
+LOCKFILE="/var/lock/plocate.daily.lock"
+if [ -e "${LOCKFILE}" ]; then
+ echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb."
+ exit 1
+fi
+touch "${LOCKFILE}"
+# trap the lockfile only if we really run the updatedb
+trap "rm -f ${LOCKFILE}" EXIT
+
+# source the user specified variables
+if [ -f /etc/plocate-cron.conf ]; then
+ . /etc/plocate-cron.conf
+fi
+
+# check the config file
+NODEVS=""
+if [ ! -f /etc/updatedb.conf ]; then
+ NODEVS=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
+fi
+
+# alter the priority of the updatedb process
+if [ -x /usr/bin/renice ]; then
+ /usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1
+fi
+if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then
+ /usr/bin/ionice -c${IONICE_CLASS:-2} -n${IONICE_PRIORITY:-7} -p $$ > /dev/null 2>&1
+fi
+
+# Cleanup old temp files from previous unsuccessful runs
+rm -f /var/lib/plocate/plocate.db.*
+
+# run the updatedb if possible
+if [ -x /usr/sbin/updatedb ]; then
+ /usr/sbin/updatedb -f "${NODEVS}"
+else
+ echo >&2 "Warning: \"/usr/sbin/updatedb\" is not executable, unable to run updatedb."
+ exit 0
+fi
diff --git a/sys-apps/plocate/files/updatedb.conf b/sys-apps/plocate/files/updatedb.conf
new file mode 100644
index 000000000000..6a00d3aa2b94
--- /dev/null
+++ b/sys-apps/plocate/files/updatedb.conf
@@ -0,0 +1,16 @@
+# /etc/updatedb.conf: config file for slocate
+
+# This file sets variables that are used by updatedb.
+# For more info, see the updatedb.conf(5) manpage.
+
+# Filesystems that are pruned from updatedb database
+PRUNEFS="afs anon_inodefs auto autofs bdev binfmt binfmt_misc cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmpfs ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"
+
+# Paths which are pruned from updatedb database
+PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool"
+
+# Folder names that are pruned from updatedb database
+PRUNENAMES=".git .hg .svn CVS"
+
+# Skip bind mounts.
+PRUNE_BIND_MOUNTS="yes"