Bug 18862 - bogus entries in keyboards table
Summary: bogus entries in keyboards table
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Marja Van Waes
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-07-05 13:29 CEST by Marja Van Waes
Modified: 2016-07-09 22:58 CEST (History)
3 users (show)

See Also:
Source RPM: drakx-kbd-mouse-x11
CVE:
Status comment:


Attachments

Description Marja Van Waes 2016-07-05 13:29:37 CEST
(In reply to Martin Whitaker from https://bugs.mageia.org/show_bug.cgi?id=14476#73 )

> 
> As an aside, there do seem to bogus entries in the keyboards table. For
> example:
> 
> % setxkbmap -layout "tifinagh(phonetic)"
> Error loading new keyboard description

Thanks, I wasn't aware of that, only that we miss a lot of entries.
(See https://bugs.mageia.org/show_bug.cgi?id=15732#c2 )

[marja@cldrn_64 /]$ grep -r tifinagh usr/share/X11/xkb/symbols/*
usr/share/X11/xkb/symbols/ma:// Clavier unicode tifinaghe de base réalisé par l'IRCAM (Institut Royal de la Culture Amazighe du Maroc) http://www.ircam.ma/
<snip>

[marja@cldrn_64 /]$ grep 'xkb_symbols' /usr/share/X11/xkb/symbols/ma
xkb_symbols "arabic" {
xkb_symbols "french" {
xkb_symbols "tifinagh" {
xkb_symbols "tifinagh-phonetic" {
xkb_symbols "tifinagh-extended" {
xkb_symbols "tifinagh-extended-phonetic" {
xkb_symbols "tifinagh-alt" {
xkb_symbols "tifinagh-alt-phonetic" {
[marja@cldrn_64 /]$

So for tifinagh, keyboard.pm should maybe, instead of 
"fr,tifinagh(basic),ara(azerty)"
have something like 
"ma(french),ma(tifinagh),ma(arabic)" (I'm not sure the original order should be kept, or whether that would be wrong)
and fr tifinagh-phonetic something like:
"ma(french),ma(tifinagh-phonetic),ma(arabic)"
(and the extended and alt keyboard layouts should probably get entries, too)

However, I don't feel like changing anything, now. All the changes (apart from the one for bug 7519 ) that I've made to keyboard.pm only turned out good because of educated guesses and luck. My fix for bug 7519 might turn out to be a disaster. I hope someone with a Mac will test it in a VM long before 6RC is released.
Comment 1 Thierry Vignaud 2016-07-05 13:43:01 CEST
I think your guess is right and than on other hands, we'll have a hard time find a tester.
So just commit your changes and close this BR.
That'll fix at least a known error.
Thierry Vignaud 2016-07-05 13:46:50 CEST

Keywords: (none) => PATCH

Thierry Vignaud 2016-07-05 13:46:58 CEST

Assignee: bugsquad => marja11

Comment 2 Martin Whitaker 2016-07-05 21:32:24 CEST
Marja, you might also find /usr/share/X11/xkb/rules/xorg.lst helpful - it lists all the valid keyboard layout and variant combinations in a fairly readable way.

There is a check() subroutine in the keyboard.pm module which looks to be designed to validate the keyboards table, but it has clearly not been used for a while, as it still refers to /usr/lib/X11/xkb/rules/xfree86.lst. I did try fixing that, but there are other files it tries to read that are also no longer present and don't have an obvious replacement.
Comment 3 Marja Van Waes 2016-07-06 09:03:04 CEST
(In reply to Thierry Vignaud from comment #1)
> So just commit your changes and close this BR.

Will do, sorry for having feared to break something that was already broken.

(In reply to Martin Whitaker from comment #2)
> Marja, you might also find /usr/share/X11/xkb/rules/xorg.lst helpful - it
> lists all the valid keyboard layout and variant combinations in a fairly
> readable way.

Thanks, I didn't know that file. So instead of "ma(arabic)" I should have proposed "ma".

And to put on top of yours & Pablo's patch for bug 14476, I understand now

   "fr,am,ara", ",tifinagh,azerty"
should become
   "ma,ma,ma", "french,tifinagh,"

and
   "fr,am,ara", ",tifinagh-phonetic,azerty"
should become 
   "ma,ma,ma", "french,tifinagh-phonetic,"

Is that correct, or is there no need to repeat "ma" 3 times?

> 
> There is a check() subroutine in the keyboard.pm module which looks to be
> designed to validate the keyboards table, but it has clearly not been used
> for a while, as it still refers to /usr/lib/X11/xkb/rules/xfree86.lst. I did
> try fixing that, but there are other files it tries to read that are also no
> longer present and don't have an obvious replacement.

Thanks for your efforts. I understand that even for people who know Perl, our code is still a labyrinth ;-)

CC: (none) => pablo

Comment 4 Marja Van Waes 2016-07-06 09:13:23 CEST
(In reply to Marja van Waes from comment #3)

>    "ma,ma,ma", "french,tifinagh-phonetic,"
> 
> Is that correct, or is there no need to repeat "ma" 3 times?
> 

I should have looked at attachment 8131 [details]

   "srp,srp",	   "basic,latin",

So, yes, repeating is apparently needed :-)
Comment 5 Pablo Saratxaga 2016-07-08 01:09:49 CEST
hello,

>    "fr,am,ara", ",tifinagh,azerty"
> should become
>    "ma,ma,ma", "french,tifinagh,"

fr(basic) and me(french) are the same (ma(french) just includes fr(basic))
same for ar(azerty) and ma(arabic).

So, using one or the other is the same.
However, I find "fr" and "ara(azerty)" easier to understand

> Is that correct, or is there no need to repeat "ma" 3 times?

There are indeed *3* keyboard layouts stacked, one in latin letters, one in tifinagh letters, one in arabic letters.

 
> > There is a check() subroutine in the keyboard.pm module which looks to be
> > designed to validate the keyboards table, but it has clearly not been used
> > for a while,

a quite simple check would be try to load the keyboard layout (that is, do a shell call to: setxkbmap "$layout" -option "$option"
if the return code is a failure, display an error message telling the
$layout $option combination is broken.
at the end of trying all layouts the original layout has to be loaded (the current values can be retrieve with: "setxkbmap -query"
Comment 6 Marja Van Waes 2016-07-08 23:46:13 CEST
(In reply to Pablo Saratxaga from comment #5)
> hello,
> 
> >    "fr,am,ara", ",tifinagh,azerty"
> > should become
> >    "ma,ma,ma", "french,tifinagh,"
> 
> fr(basic) and me(french) are the same (ma(french) just includes fr(basic))
> same for ar(azerty) and ma(arabic).
> 
> So, using one or the other is the same.
> However, I find "fr" and "ara(azerty)" easier to understand

I agree that they are easier to understand. 
I had seen the includes, but remembered when we had the ⬠added. If Morocco would decide to have a dedicated symbol for their currency, it would then end up in the ma layouts. However, we can still adjust it _if_ that ever happens at all, so let's just do what you prefer, and only switch from "am" to "ma" for tifinagh.
Comment 7 Mageia Robot 2016-07-09 22:48:25 CEST
commit 6bc379e2f3884590878644bd7b92a6a2f17e846b
Author: Marja van Waes <marja@...>
Date:   Sat Jul 9 22:34:16 2016 +0200

    Last fix for two bogus keyboards table entries (mga#18862)
    o after Pablo already fixed a bunch of them.
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx-kbd-mouse-x11/commit/?id=6bc379e2f3884590878644bd7b92a6a2f17e846b
Comment 8 Marja Van Waes 2016-07-09 22:58:31 CEST
fixed in git

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.