Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353122 - sys-apps/mlocate-0.23.1: syntax error in /etc/cron.daily/mlocate
Summary: sys-apps/mlocate-0.23.1: syntax error in /etc/cron.daily/mlocate
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: Tomáš Chvátal (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-01-29 11:32 UTC by Christian Seiler
Modified: 2011-01-30 13:17 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Seiler 2011-01-29 11:32:16 UTC
There is a syntax error in /etc/cron.daily/mlocate that is installed with the package sys-apps/mlocate-0.23.1; there is a "fi" missing in line 38.

Reproducible: Always

Steps to Reproduce:
1. Install sys-apps/mlocate-0.23.1 on a fresh system
2. Wait until midnight until the cronjob is run -or- directly run /etc/cron.daily/mlocate as root

Actual Results:  
- "Syntax error" on execution of cron.daily script
- "locate foo" does not work, because no database is ever generated


Expected Results:  
updatedb is run

Installed script:
--------------------------------------------------------------------
if [ -x /usr/bin/renice ]; then
        /usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1
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
--------------------------------------------------------------------

Correct version would be:
--------------------------------------------------------------------
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
--------------------------------------------------------------------
Comment 1 René 'Necoro' Neumann 2011-01-30 03:25:01 UTC
If anyone else also struggles for a moment to find the difference: The first if-block misses the ending 'fi'
Comment 2 Ulrich Müller gentoo-dev 2011-01-30 12:26:44 UTC
Increasing severity, because this is an ubiquitous package, and the breakage affects the stable version.
Comment 3 Tomáš Chvátal (RETIRED) gentoo-dev 2011-01-30 13:17:03 UTC
I am really sorry for such typo :/


+*mlocate-0.23.1-r1 (30 Jan 2011)
+
+  30 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> -mlocate-0.22.4.ebuild,
+  -mlocate-0.23.1.ebuild, +mlocate-0.23.1-r1.ebuild, files/mlocate.cron-r2:
+  Revision bump with perserved stable keywords. Fix typo in cronfile that
+  prevented cronjob to operate per bug #353122. Drop older affected version to
+ ensure everyone upgrade.
+

Btw ad the criticalness i am not particulary sure it is this high (you can always regen the db by hand or use locate).

Anyway mea culpa maxima and sorry for not spotting it.