[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#658668: console-setup: Only include the debconf-selectable layouts in udeb



Here is a fixed version: the config script assumes that the keyboard
names are not empty. This simply puts a "K" everywhere to make it happy
(possibly not worth spending the bytes to handle empty keyboard names).

Samuel
diff --git a/Keyboard/Makefile b/Keyboard/Makefile
index e6c22cc..22fdd3f 100644
--- a/Keyboard/Makefile
+++ b/Keyboard/Makefile
@@ -17,11 +17,13 @@ build-mini-freebsd : $(gzipped_ekbds) charmap_functions.sh
 %.gz : %
 	gzip -9 <$< >$@
 
-%.ekmap : 
-	./kbdcompiler $(@:%.ekmap=%) KeyboardNames.pl $(xkbdir) >$@
+choices :
+	grep -A 2 keyboard-configuration/xkb-keymap ../debian/console-setup-udeb.templates | tail -n 1 | cut -d ' ' -f 2- | tr -d , | tr ' ' '\n' | grep -v skip-config > $@
+%.ekmap : choices
+	cat $< | ./kbdcompiler $(@:%.ekmap=%) KeyboardNames.pl $(xkbdir) >$@
 
-%.ekbd : 
-	./kbdcompiler freebsd-$(@:%.ekbd=%) KeyboardNames.pl $(xkbdir) >$@
+%.ekbd : choices
+	cat $< | ./kbdcompiler freebsd-$(@:%.ekbd=%) KeyboardNames.pl $(xkbdir) >$@
 
 charmap_functions.sh : $(acmfiles)
 	./make_charmap_functions ../acm $(charmaps) >$@
@@ -68,7 +70,7 @@ clean:
 	-rm -rf linux-keymaps freebsd-keymaps keymaps
 	-rm -f keymaps.dir names.list
 	-rm -f charmap_functions.sh
-	-rm -f $(gzipped_ekmaps) $(gzipped_ekbds)
+	-rm -f choices $(gzipped_ekmaps) $(gzipped_ekbds)
 
 .PHONY: maintainer-clean
 maintainer-clean: clean
diff --git a/Keyboard/kbdcompiler b/Keyboard/kbdcompiler
index 1c4fc78..5998564 100755
--- a/Keyboard/kbdcompiler
+++ b/Keyboard/kbdcompiler
@@ -81,14 +81,20 @@ ensuredir $dir;
 
 printf STDERR "Compiling compact keymaps for %s...\n", $model;
 
-for my $layout (values %KeyboardNames::layouts) {
-    next if ($layout eq 'nec/jp');
-    next if ($layout eq 'nec_vndr/jp');
+for my $choice (<STDIN>) {
+    chomp $choice;
+    my $layout = $choice;
+    my $variant = "";
+    if ($choice =~ /\(/) {
+    	$layout =~ s/\(.*//;
+	$variant = $choice;
+    	$variant =~ s/.*\((.*)\)/$1/;
+    }
+
     my $actual_layout = (($layout eq 'cs') ? 'cs,cs'
 			 : (($layout eq 'lt') ? 'lt,lt'
 			    : (($nonlatin =~ / $layout /)
 			       ? "us,$layout" : $layout)));
-    for my $variant ('', values %{$KeyboardNames::variants{$layout}}) {
 	my $actual_variant;
 	if ($actual_layout eq 'cs,cs') {
 	    if ($variant =~ /latin/) {
@@ -123,7 +129,6 @@ for my $layout (values %KeyboardNames::layouts) {
 	if (-f "$dir/$model-$layout:$variant") {
 	    read_temp_kmap "$layout:$variant";
 	}
-    }
 }
 
 sub subtraction {
diff --git a/debian/rules b/debian/rules
index 68252ae..a4e2d10 100755
--- a/debian/rules
+++ b/debian/rules
@@ -195,6 +195,7 @@ install-udeb: build
 	install -m0755 debian/keyboard-configuration.config \
 		debian/console-setup-udeb/usr/share/console-setup/
 	$(pre) --mini debian/console-setup-udeb/usr/share/console-setup/keyboard-configuration.config
+	sed -i -e '/all_kbdnames/,/^EOF/s/\(.*\*\)[^*]*/\1K/' debian/console-setup-udeb/usr/share/console-setup/keyboard-configuration.config
 	dh_install -p console-setup-udeb debian/kbdnames.gz usr/share/console-setup
 	dh_installdirs -p console-setup-udeb lib/debian-installer.d/
 	install -m0644 debian/console-setup-udeb.startup \

Reply to: