Re: 2.2.6 keymap problem...
Hi, Joey. thank you for your advice.
Please let me ask you some questions.
In article <[🔎] 20000204094346.B8848@kitenet.net>,
at Fri, 4 Feb 2000 09:43:46 -0800,
on Re: 2.2.6 keymap problem...,
Joey Hess <joeyh@debian.org> writes:
> Taketoshi Sano wrote:
> > This shows 'console-data' and 'console-data\n' as owners,
> > somewhat strange. (debconf has similar "owner" lines, but all other
> > packages just have '<package>' only. no other '<package>\n' is there.
>
> The \n lines were caused by a debconf bug 3 or 4 months ago. As far as I
> know, that bug was fixed. Anyway, it's a redherring, the most such luines
> can do is prevent a value from being removed from the debconf database when
> a package is purged.
Then, these strange value does not cause the problem, I see.
But I found that "dpkg-reconfigure console-data" does not hold
the previous setting.
In /var/lib/debconf/debconf.db, there are
}, 'Debian::DebConf::Question' ),
'shared/keymap/layout' => bless( {
'variables' => {
'choices' => 'azerty, dvorak, fgGIod, qwerty, qwertz'
},
'name' => 'shared/keymap/layout',
'flag_isdefault' => 'false',
'template' => $templates{'shared/keymap/layout'},
'value' => '',
'owners' => {
'console-data' => 1,
'console-data
' => 1
}
In this part, "'flag_isdefault' => 'false'" means that this question has
been answered, and not displayed on normal upgrade, I think. Is this OK ?
And I suppose that "'value' => ''," in this part also means that
the answer is the default one provided by the package. Am I wrong here ?
In this setting, "dpkg-reconfigure console-data" shows the dialog
with the "azerty" as the default layout.
I select "qwerty" at the prompt, and answer the rest questions,
but the "'value'" is not changed from "''". And when I do
"dpkg-reconfigure console-data" nexttime, the the dialog shows
the "azerty" as the default layout again.
Once I edit this part manually to set "'value' => 'qwerty',"
then "dpkg-reconfigure console-data" show the "qwerty" as the default layout.
Is this the normal and right action for console-data ? I don't see why.
Other parts which is used by console-data, has all "'value' => '',"
and does not keep the previous answer when using dpkg-reconfigure.
}, 'Debian::DebConf::Question' ),
'shared/keymap/variant' => bless( {
'name' => 'shared/keymap/variant',
'variables' => {
'choices' => ''
},
'flag_isdefault' => 'false',
'template' => $templates{'shared/keymap/variant'},
'value' => '',
'owners' => {
'console-data' => 1,
'console-data
' => 1
}
And more strangely, country setting is not set 'flag_isdefault' to false
}, 'Debian::DebConf::Question' ),
'shared/keymap/country' => bless( {
'variables' => {
'choices' => ''
},
'name' => 'shared/keymap/country',
'flag_isdefault' => 'true',
'template' => $templates{'shared/keymap/country'},
'value' => '',
'owners' => {
'console-data' => 1,
'console-data
' => 1
}
I did select countries (USA and Japan) several times in the dialog
of "dpkg-reconfigure", but the 'flag_isdefault' in this part is
never set to "false". The previous selection is not hold here again.
When I manually edit the debconf.db to set my selection into these
"value", then dpkg-reconfigure keeps my setting.
I doubt the config script of console-data.
In /var/lib/dpkg/console-data.config, it seems that following part is
the code to select the setting.
=====
# Do one level of user-querying.
# This is the heart of the hierarchical mechanism.
sub onelevel {
my ($hash, $confvar, $prevState, $nextState) = @_;
my ($code, $choice, $newState, $oldchoice);
# get choices to be presented
my @choices = sort {uc($a) cmp uc($b)} keys %$hash;
# insert them in debconf variable definition, and ask
my $choices = join (', ', @choices);
subst ($confvar, 'choices', $choices);
input ('high', $confvar);
# memorize old choice
($code, $oldchoice) = get ($confvar);
#
($code, undef) = go ();
if ($code == 30) { # "back"
$newState = $prevState;
} elsif ($code == 0) {
(undef, $choice) = get ($confvar);
$newState = $nextState;
} else {
die "go() returned unhandled code $code";
}
my $newchoice = {};
my $changed = 0;
if (defined $choice) {
$newchoice = $hash->{$choice};
$changed = ($choice ne $oldchoice);
}
# print "Choice: $newchoice, State: $newState\n";
return ($newchoice, $newState, $changed);
}
=====
LOOP: while ($state != 99) {
($state == 0) && do { # get_layout
($countriesRef, $state, $changed) =
onelevel ($defs->{architems}, $defs->{levels}->[0], 0, 1);
# if ($ret eq "back") {
# previous_module;
# exit;
# }
if ($changed) {
reset $defs->{levels}->[1];
}
next LOOP;
};
($state == 1) && do { # get_country
($variantsRef, $state, $changed) =
onelevel ($countriesRef, $defs->{levels}->[1], 0, 2);
if ($changed) {
reset $defs->{levels}->[2];
}
next LOOP;
};
($state == 2) && do { # get_variant
(undef, $state, $changed) =
onelevel ($variantsRef, $defs->{levels}->[2], 1, 99);
if ($changed) {
(undef, $variant) = get ($defs->{levels}->[2]);
$keymapFilename = $variantsRef->{$variant};
set ($defs->{output}, $keymapFilename);
}
next LOOP;
};
}
}
=====
Is these section right ? I grep "input" in this file, the only one line
which has this word is
input ('high', $confvar);
in the former part above. I feel something is missing in this file,
but I have not fully understand the debconf yet...
# I read the docs of debconf for the first time, to check this problem :)
--
Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>
Reply to: