Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292813 - openoffice should depend on the correct spell-checking dictionary when LINGUAS is set
Summary: openoffice should depend on the correct spell-checking dictionary when LINGUA...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-11 16:59 UTC by Lars
Modified: 2010-04-11 13:27 UTC (History)
1 user (show)

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


Attachments
patch openoffice to depend on the correct dictionary indicated by the LINGUAS flag (openoffice_correct_spellchecker.patch,793 bytes, text/plain)
2009-11-25 13:09 UTC, Lars
Details
depend on "en" dictionary in case of "en_GB" lingua (openoffice-3.2.0.ebuild.diff,1.39 KB, patch)
2010-04-11 13:04 UTC, Lars
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars 2009-11-11 16:59:26 UTC
on amd64, emerging app-office/openoffice-3.1.1 does not install the according dictoinaries indicated by the LINGUAS flag

Reproducible: Always

Steps to Reproduce:
edit /etc/make.conf to contain LINGUAS="de" (short for german) an then
emerge openoffice
Actual Results:  
hunspell is emerged, but not app-dicts/myspell-de, the german dictionary for it

Expected Results:  
emerge openoffice also triggers an emerge of app-dicts/myspell-de

I think this is trivial to add to the ebuild and would save many users the time to find out, why they have a localized version of openoffice, but cannot spell-check their language.
Comment 1 Andreas Proschofsky (RETIRED) gentoo-dev 2009-11-25 09:20:50 UTC
This is on my todo list but with VERY low priority, so if you want to give it a shot: patches welcome ;-)
Comment 2 Lars 2009-11-25 13:09:44 UTC
Created attachment 211158 [details]
patch openoffice to depend on the correct dictionary indicated by the LINGUAS flag

ok, i'm not an ebuild-expert, but here we go: the ebuild patch. works for me, i.e.: if i unemerge myspell-de and emerge -pv openoffice (having LINGUAS="de" in /etc/make.conf), it wants to reinstall myspell-de, if and only if the ebuild is patched. should work for openoffice-bin as well (just copy and paste the 7+1 lines)
Comment 3 Lars 2009-11-25 13:18:35 UTC
btw: should work not only for "de" (german), but also for all in "af bg ca cs cy da de el en eo es et fr ga gl he hr hu it ku lt mk nb nl nn pl pt ru sk sl sv tn zu"
Comment 4 Andreas Proschofsky (RETIRED) gentoo-dev 2009-11-28 20:55:01 UTC
I've added this to the 3.1.1-ebuild now, thanks @lars for the patch!

Closing
Comment 5 Jeremy Murphy 2010-04-11 09:23:02 UTC
Hi!  There is a bug in this patch, unfortunately.  :)  It does not work for localized linguas like en_GB.  So the ebuild needs to take just the first two characters of any LINGUAS entry so that "en_XX" => "en".  Cheers.
Comment 6 Lars 2010-04-11 09:47:03 UTC
the problem is that some linguas don't have a myspell-dictionary at all, so just taking the first two letters in generall would break the emerge for those people (because the openoffice-ebuild would then depend on e.g. myspell-eu, which does not exist). that's why my patch contained a list of cases, where lingua is identical to the dictionary name.

as a simple patch, it would be possible to add a line like the following after the SPELL_DIRS_DEPEND loop in the ebuild:
SPELL_DIRS_DEPEND="${SPELL_DIRS_DEPEND} linguas_en_GB? ( app-dicts/myspell-en )"
and likewise for every other such case

although i thought, English would be emerged by default :-)

for a really good solution, we would need a mapping between linguas and dictionaries. yet i don't have a smart solution, let me re-think this. maybe someone else has an idea how to do this in an elegent manner.

these are the linguas:
af ar as_IN be_BY bg bn br brx bs ca cs cy da de dgo dz el en en_GB en_ZA eo es et eu fa fi fr ga gl gu he hi_IN hr hu id it ja ka kk km kn_IN ko kok ks ku lt mai mk ml_IN mn mni mr_IN nb ne nl nn nr ns oc or_IN pa_IN pl pt pt_BR ru rw sa_IN sat sd sh sk sl sr ss st sv sw_TZ ta ta_IN te_IN tg th ti_ER tn tr ts uk ur_IN uz ve vi xh zh_CN zh_TW zu

and these are the dictionaries:
myspell-af
myspell-bg
myspell-ca
myspell-cs
myspell-cy
myspell-da
myspell-de
myspell-de-alt
myspell-el
myspell-en
myspell-eo
myspell-es
myspell-et
myspell-fo
myspell-fr
myspell-ga
myspell-gl
myspell-he
myspell-hr
myspell-hu
myspell-ia
myspell-id
myspell-it
myspell-ku
myspell-lt
myspell-lv
myspell-mi
myspell-mk
myspell-ms
myspell-nb
myspell-nl
myspell-nn
myspell-pl
myspell-pt
myspell-ro
myspell-ru
myspell-sk
myspell-sl
myspell-sv
myspell-sw
myspell-tn
myspell-uk
myspell-zu

(i think this "bug" is still just a small inconvenience)
Comment 7 Jeremy Murphy 2010-04-11 12:11:13 UTC
Hmm, so at the moment, the ebuild adds every possible dictionary as an optional dependency.  Perhaps instead, it could add all the user's LINGUAS as compulsory dependencies, if they exist as a dictionary.  So, in pseudobashcode:

SPELL_DIRS="af bg ca cs cy da de ..."
for lingua in $LINGUAS; do
    if ${lingua:0:2} is a member of $SPELL_DIRS; then
        add myspell-${lingua:0:2} as an RDEPEND
    else
        echo "Sorry, I can't spell lingua: ${lingua}"
    fi
done

So that way, if additional localizations (en_AU, en_NZ, etc) are added later, they will be handled automagically!  Yay!  What do you think?

${var:X:Y} means take Y characters starting at index X, in case you weren't familiar with it.  (I had to look up how to do it.)


As an aside, I think this is quite an important bug, because the idea of installing OpenOffice and the spellcheck doesn't even work is embarrassing.  It's the sort of basic, obvious thing, and in a high profile package, that would make me question the quality control of a Linux distribution.  No offence meant, I'm just making the point that it's worth fixing because it looks bad if Gentoo can't get something like this right.
Comment 8 Lars 2010-04-11 13:04:08 UTC
Created attachment 227361 [details, diff]
depend on "en" dictionary in case of "en_GB" lingua

hm, as i said, i am not a ebuild expert and right now i am too lazy to find out, what RDEPEND is for :-) and i don't know, whether the $lingua varibale is set the way you proposed it, but still i agree that it makes sence to depend on the "en" dictonary in case of an "en_GB" lingua. so, i followed the basic idea and made this little patch, which should be a little bit more rebust to later changes. it's for openoffice-3.2.0, but the principle should work fine for openoffice-3.1.1 and the openoffice-bin versions, as well.

by the way: if i had thought, that this is completly irrelevent, i wouldn't have opened the bug ;-)
Comment 9 Jeremy Murphy 2010-04-11 13:27:42 UTC
Looks great!  I will test it later.