Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 559568

Summary: sys-apps/mlocate: cronjob script should be a bit clearer
Product: Gentoo Linux Reporter: kfm
Component: [OLD] Core systemAssignee: Christian Faulhammer (RETIRED) <fauli>
Status: RESOLVED FIXED    
Severity: enhancement CC: base-system
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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