Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322481 - emerge --config postgresql-server does not work with nonstandard locales due to erroneous regex
Summary: emerge --config postgresql-server does not work with nonstandard locales due ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
: 322485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-02 15:30 UTC by Oliver Kleinecke
Modified: 2010-06-07 13:12 UTC (History)
0 users

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 Oliver Kleinecke 2010-06-02 15:30:20 UTC
The Regex in the line 
[code]MATCHSTRING="([cC]|[pP][oO][sS][iI][xX]|[a-z][a-z]_[A-Z][A-Z]\.[[:alnum:]_-]+)"[/code] of any newer postgresql-server.ebuild file
does not match locales like e.g. de_DE@euro, although those are valid locales. Therefore, emerge --config fails complaining about locales not being set correctly, although everything`s fine.


Reproducible: Always

Steps to Reproduce:
emerge --config dev-db/postgresql-server with "nontypic" localename, like de_DE@euro set in /etc/env.d/02locale

Actual Results:  
emerge --config dev-db/postgresql-server fails complaining about wrong locale-settings when using valid, but nontypic localenames


The problem is the regex in the postgresql-server.ebuild :
MATCHSTRING="([cC]|[pP][oO][sS][iI][xX]|[a-z][a-z]_[A-Z][A-Z]\.[[:alnum:]_-]+)"
will NOT match untypical localenames. Works fine with typical ones, like en_US.iso...
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2010-06-02 19:57:31 UTC
*** Bug 322485 has been marked as a duplicate of this bug. ***
Comment 2 Aaron W. Swenson gentoo-dev 2010-06-02 20:34:12 UTC
While I know how to fix the regex to accept that, that whole script is being dropped in the next revision for the latest releases.

It was a work around for environments not being set properly if the environment changed post-emerge.

So, this will be fixed by its removal.
Comment 3 Oliver Kleinecke 2010-06-04 12:44:52 UTC
When will this exactly be? This bug renders the whole postgresql-server uninstallable via portage (as long as you don know how to bugfix yourself :D) at the moment.. and there are MANY!!!!!! users like me, that do not use locale-names working with the current script ... If this is such a tiny thing, put it upstream asap PLZ!
Comment 4 Oliver Kleinecke 2010-06-04 13:13:05 UTC
BTW: (Sry, cannot keep it with me) :
[quote]# This could probably use a little work, but is sufficient.[/quote]
.. had to laugh a lot `bout this lovely comment (kind of a crazy, helpless laughter, though) .. this is NOT sufficient.. it`s a perfect case to demonstrate why quick&dirty "hacks" like this are NOT to be put upstream (thousands of exlamation marks following!)
Comment 5 Aaron W. Swenson gentoo-dev 2010-06-04 20:32:38 UTC
(In reply to comment #4)
> BTW: (Sry, cannot keep it with me) :
> [quote]# This could probably use a little work, but is sufficient.[/quote]
> .. had to laugh a lot `bout this lovely comment (kind of a crazy, helpless
> laughter, though) .. this is NOT sufficient.. it`s a perfect case to
> demonstrate why quick&dirty "hacks" like this are NOT to be put upstream
> (thousands of exlamation marks following!)
> 

Take it easy now. There's a lot of work that go into finding and testing solutions. The regex is sufficient, for people that have sane locales like me, or what I would call sane. Furthermore, there are only so many things and ways a single person can think of to test an ebuild and program before putting it out there. Eventually, it must be released in to the wild.

Which brings me to this most important point: If you don't want to have problems like this, don't run testing on your machine.

If you want to run testing, fine. But be helpful rather than accusatory and demeaning.

This won't be given to upstream because it isn't their problem to handle. It'll stay right here in our hands.
Comment 6 Aaron W. Swenson gentoo-dev 2010-06-05 19:48:11 UTC
The -r1's have been committed to the tree. This bug should be resolved.
Comment 7 Oliver Kleinecke 2010-06-07 13:12:33 UTC
Just wanted to apologize for being so rude. Indeed you are completely right with your point that being demeaning and accusatory wont help anybody.
But I also wanted to emphasize one point :
de_DE@euro IS a sane locale, that is used by anybody that wants to use a german keyboard with the € - currency symbol. You can image that these are a lot of people ;).
Neverless you are also right about the point that nobody will ever be able to check any possible circumstances, so again, I am sorry for my rude behavior. Indeed we can all be happy that postgresql on gentoo is maintained actively at all.

Another thing : I think it would be a clever idea to pipe the output of "locale -a" to an array line by line, and to check if the currently selected locale is an existing array value. This would make this sanity check a lot safer .. but since this was a temporary solution anyway (if I got that right), this is just a quick idea :)

Also : confirmed that -r1 works fine.. so I`ll set this bug to "FIXED". :) Thanks