Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559568 - sys-apps/mlocate: cronjob script should be a bit clearer
Summary: sys-apps/mlocate: cronjob script should be a bit clearer
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Christian Faulhammer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-04 05:10 UTC by kfm
Modified: 2015-09-05 00:22 UTC (History)
1 user (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 kfm 2015-09-04 05:10:34 UTC
While /etc/cron.daily/mlocate is a /bin/sh script, line #31 is as thus:

NODEVS=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }')

The $(< file) form of substitution is a feature of bash. In a strictly POSIX compliant shell, this will cause NODEVS to be empty.

Please change it to:

NODEVS=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
Comment 1 kfm 2015-09-04 05:18:14 UTC
My apologies, as this bug is INVALID; the use of the redirection operator as part of the command executed in the subshell is absolutely fine. Still, I would recommend not putting the redirection at the front because it's confusing to those who work with both bash and sh.
Comment 2 SpanKY gentoo-dev 2015-09-05 00:22:47 UTC
i just made it an explicit arg to awk rather than letting awk read stdin

http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=401cbc5c998ed65d8421cae8f2a0c39ca798a626