Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134600 - BSD patch broke strip-linguas
Summary: BSD patch broke strip-linguas
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL: http://sources.gentoo.org/viewcvs.py/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-28 01:58 UTC by Harald van Dijk (RETIRED)
Modified: 2006-06-07 05:54 UTC (History)
2 users (show)

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


Attachments
patch (strip-linguas,1.54 KB, patch)
2006-05-28 01:59 UTC, Harald van Dijk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk (RETIRED) gentoo-dev 2006-05-28 01:58:44 UTC
strip-linguas got broken by a BSD compatibility patch. Now, it misbehaves on any system equally :) The patch essentially did a tr ' ' '\n' on GNU/Linux, when strip-linguas relied on spaces. Here's a patch that fixes this, and cleans up a little bit.

I ran into this with sawfish. It claimed any LINGUAS value was invalid, even those for which translations exist.
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2006-05-28 01:59:41 UTC
Created attachment 87707 [details, diff]
patch
Comment 2 SpanKY gentoo-dev 2006-06-04 03:26:49 UTC
executing `basename` is just retarded as it slows things down
Comment 3 SpanKY gentoo-dev 2006-06-04 06:26:36 UTC
i merged the find/hasq changes but i dont quite get this:
-		for d in "$@" ; do
+		for d ; do
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2006-06-04 07:31:03 UTC
> i merged the find/hasq changes but i dont quite get this:
> -               for d in "$@" ; do
> +               for d ; do

in "$@" is implied if nothing is given after the variable name, there's no need to state it. in "$@" works as well, so if you'd rather leave it, that's fine too; style can be discussed without ever agreeing :)
Comment 5 SpanKY gentoo-dev 2006-06-04 08:22:58 UTC
for d ; do
isnt very intuitive

things should be fixed in cvs now ... if you feel like rewriting it so it doesnt -exec basename, i'd be happy ;)
Comment 6 Benigno B. Junior (RETIRED) gentoo-dev 2006-06-04 11:04:36 UTC
Giving the basename's work to sed might help a lot. See some tests:
# ls=$(find /usr/portage -name '*.ebuild' -exec basename {} .ebuild \;)
real    0m14.910s

# ls=$(find /usr/portage -name '*.ebuild' | sed 's:.*/\([^/]*\).ebuild:\1:')
real    0m1.169s

(In reply to comment #2)
> executing `basename` is just retarded as it slows things down
>
Hmm, but a much more retarded than this would be the old instruction
"ls=${ls//.po}", present in r1.235, which could lock up bash if it had a lot
of work to do.
Comment 7 SpanKY gentoo-dev 2006-06-07 05:54:15 UTC
> Giving the basename's work to sed might help a lot. See some tests:

i dont really undertand this sentence, but using sed seems like it'd be kind of a pain to extra all the right data

> Hmm, but a much more retarded than this would be the old instruction
> "ls=${ls//.po}", present in r1.235, which could lock up bash if it had a lot
> of work to do.

if by "a lot of work" you mean "ls is a string whose length is many kilobytes long", then yes you are correct

but considering that use case is in the realm of very very unlikely, your point has not value