Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 159786 - net-analyzer/mrtg init script fails with UTF-8 locale and bash-3.2
Summary: net-analyzer/mrtg init script fails with UTF-8 locale and bash-3.2
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-02 15:07 UTC by Lars T. Mikkelsen
Modified: 2007-01-11 10:59 UTC (History)
0 users

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


Attachments
mrtg.rc.patch (mrtg.rc.patch,355 bytes, patch)
2007-01-02 15:08 UTC, Lars T. Mikkelsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.