summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-01-31 13:17:10 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2011-01-31 13:17:10 +0000
commitbe2292299d640ccdcb0b631f1a7328fd9f4d6abb (patch)
tree7502aa772e218c6fcacd598fba028488a458bc75 /sys-apps/mlocate
parentVersion bump, remove old, dvips and latex are required (bug #345121). (diff)
downloadgentoo-2-be2292299d640ccdcb0b631f1a7328fd9f4d6abb.tar.gz
gentoo-2-be2292299d640ccdcb0b631f1a7328fd9f4d6abb.tar.bz2
gentoo-2-be2292299d640ccdcb0b631f1a7328fd9f4d6abb.zip
Fix premature removing of the lock file and parse the args more sanely when there is no config around. This fixes bug #353270.
(Portage version: 2.2.0_alpha19/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/mlocate')
-rw-r--r--sys-apps/mlocate/ChangeLog6
-rw-r--r--sys-apps/mlocate/files/mlocate.cron-r213
2 files changed, 11 insertions, 8 deletions
diff --git a/sys-apps/mlocate/ChangeLog b/sys-apps/mlocate/ChangeLog
index ae09305f484e..6f35c652ff79 100644
--- a/sys-apps/mlocate/ChangeLog
+++ b/sys-apps/mlocate/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/mlocate
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/mlocate/ChangeLog,v 1.84 2011/01/30 13:16:50 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/mlocate/ChangeLog,v 1.85 2011/01/31 13:17:10 scarabeus Exp $
+
+ 31 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> files/mlocate.cron-r2:
+ Fix premature removing of the lock file and parse the args more sanely when
+ there is no config around. This fixes bug #353270.
*mlocate-0.23.1-r1 (30 Jan 2011)
diff --git a/sys-apps/mlocate/files/mlocate.cron-r2 b/sys-apps/mlocate/files/mlocate.cron-r2
index 6babee2eae2d..51cb504977e2 100644
--- a/sys-apps/mlocate/files/mlocate.cron-r2
+++ b/sys-apps/mlocate/files/mlocate.cron-r2
@@ -12,13 +12,13 @@ fi
# check if we are already running (lockfile)
LOCKFILE="/var/lock/mlocate.daily.lock"
-trap "rm -f ${LOCKFILE}" EXIT
if [ -e "${LOCKFILE}" ]; then
echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb."
exit 1
-else
- touch "${LOCKFILE}"
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/mlocate-cron.conf ]; then
@@ -26,10 +26,9 @@ if [ -f /etc/mlocate-cron.conf ]; then
fi
# check the config file
-ARGS=""
+NODEVS=""
if [ ! -f /etc/updatedb.conf ]; then
- nodevs=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }')
- ARGS="-f ${nodevs}"
+ NODEVS=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }')
fi
# alter the priority of the updatedb process
@@ -42,7 +41,7 @@ fi
# run the updatedb if possible
if [ -x /usr/bin/updatedb ]; then
- /usr/bin/updatedb ${ARGS}
+ /usr/bin/updatedb -f "${NODEVS}"
else
echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb."
exit 0