From b8611f40c874dea2ffe185ab34504d3621eb54b6 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 30 Nov 2010 16:33:19 +0100 Subject: [PATCH] findutils: provide a default updatedb.conf to exclude some stuff, bumprev. --- srcpkgs/findutils/files/updatedb.conf | 9 +++++++++ srcpkgs/findutils/files/updatedb.cron-daily | 15 ++++++++++++++- srcpkgs/findutils/template | 7 ++++++- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/findutils/files/updatedb.conf diff --git a/srcpkgs/findutils/files/updatedb.conf b/srcpkgs/findutils/files/updatedb.conf new file mode 100644 index 0000000000..1e63312475 --- /dev/null +++ b/srcpkgs/findutils/files/updatedb.conf @@ -0,0 +1,9 @@ +# Configuration file for updatedb(1) from findutils. +# +# Directories to exclude from the database: +PRUNEPATHS="/media /mnt /tmp /var/tmp /var/cache /var/lock /var/run /var/spool" + +# Filesystems to exclude from the database: +PRUNEFS="afs auto autofs binfmt_misc cifs coda configfs cramfs debugfs devpts" +PRUNEFS="$PRUNEFS devtmpfs ftpfs iso9660 mqueue ncpfs nfs nfs4 proc ramfs" +PRUNEFS="$PRUNEFS securityfs shfs smbfs sshfs sysfs tmpfs udf usbfs vboxsf" diff --git a/srcpkgs/findutils/files/updatedb.cron-daily b/srcpkgs/findutils/files/updatedb.cron-daily index c581ac7f9d..6852ea1b78 100755 --- a/srcpkgs/findutils/files/updatedb.cron-daily +++ b/srcpkgs/findutils/files/updatedb.cron-daily @@ -1,6 +1,19 @@ #!/bin/sh +# Read system defaults. +if [ -r /etc/updatedb.conf ]; then + . /etc/updatedb.conf +fi + +if [ -n "$PRUNEFS" ]; then + args="$args --prunefs='$PRUNEFS'" +fi + +if [ -n "$PRUNEPATHS" ]; then + args="$args --prunepaths='$PRUNEPATHS'" +fi + # Update the "locate" database if [ -x /usr/bin/updatedb ]; then - /usr/bin/updatedb + /usr/bin/updatedb ${args} fi diff --git a/srcpkgs/findutils/template b/srcpkgs/findutils/template index f0a360c853..112aefd221 100644 --- a/srcpkgs/findutils/template +++ b/srcpkgs/findutils/template @@ -1,6 +1,7 @@ # Template file for 'findutils' pkgname=findutils version=4.4.2 +revision=1 distfiles="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$version.tar.gz" build_style=gnu_configure configure_args="--localstatedir=/var/lib/locate" @@ -13,13 +14,17 @@ long_desc=" other programs to provide modular and powerful directory search and file locating capabilities to other commands." +conf_files="/etc/updatedb.conf" + Add_dependency run glibc Add_dependency build gettext Add_dependency build texinfo post_install() { - # Insdtall the cron daily job. + # Install the cron daily job. install -D -m744 ${FILESDIR}/updatedb.cron-daily \ ${DESTDIR}/etc/cron.daily/updatedb + # Install the updatedb conf file. + install -D -m640 ${FILESDIR}/updatedb.conf ${DESTDIR}/etc/updatedb.conf }