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

Bug 159786

Summary: net-analyzer/mrtg init script fails with UTF-8 locale and bash-3.2
Product: Gentoo Linux Reporter: Lars T. Mikkelsen <ltm>
Component: New packagesAssignee: Gentoo Netmon project <netmon>
Status: VERIFIED TEST-REQUEST    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: mrtg.rc.patch

Description Lars T. Mikkelsen 2007-01-02 15:07:35 UTC
If using a UTF-8 locale and Bash 3.2 the mrtg init script fails set LANG=C required for mrtg to run. The original issue with UTF-8 locales was fixed in bug 132652, but when using Bash 3.2 the regular expression used fails. According to the Wikipedia entry for Bash "the regular expression begins with the first non-whitespace character after =~" as of Bash 3.2. The attached patch removes the single quotes form the regular expression and thus fixing the issue. I haven't tested how this affects versions prior to 3.2.
Comment 1 Lars T. Mikkelsen 2007-01-02 15:08:40 UTC
Created attachment 105248 [details, diff]
mrtg.rc.patch
Comment 2 Cédric Krier gentoo-dev 2007-01-03 14:56:40 UTC
Replace with a grep
Fix in cvs
Comment 3 Lars T. Mikkelsen 2007-01-03 23:53:59 UTC
Thanks, the fix works. Closing bug.
Comment 4 Denis Knauf 2007-01-11 10:59:48 UTC
better, use this:
echo "$LANG" | grep -E '((^[A-Za-z0-9\_\@\-]+\.)|(^))([uU][tT][fF]-?8)$' && LANG='C'

it's faster and needn't the [[ ]]-crap.