From: Mauro Carvalho Chehab Date: Mon, 8 Nov 2010 17:41:26 +0000 (-0200) Subject: gen_keytables.pl: Warn if a in-driver table is found X-Git-Tag: v4l-utils-0.8.2~115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf4e76013920e26d010d92196fec769152212be5;p=platform%2Fupstream%2Fv4l-utils.git gen_keytables.pl: Warn if a in-driver table is found Signed-off-by: Mauro Carvalho Chehab --- diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl index 9d295be..d8cc664 100755 --- a/utils/keytable/gen_keytables.pl +++ b/utils/keytable/gen_keytables.pl @@ -10,7 +10,10 @@ my $out; my $read=0; my $type = $deftype; my $check_type = 0; +my $name; +my $warn; +my $filename = shift or die "Need a file name to proceed."; sub flush() { return if (!$keyname || !$out); @@ -20,12 +23,18 @@ sub flush() print OUT $out; close OUT; + if (!$name) { + $warn++; + } + $keyname = ""; $out = ""; $type = $deftype; + $name = ""; } -while (<>) { +open IN, "<$filename"; +while () { if (m/struct\s+ir_scancode\s+(\w[\w\d_]+)/) { flush(); @@ -39,6 +48,10 @@ while (<>) { $check_type = 1; next; } + if (m/\.name\s*=\s*(RC_MAP_[^\s\,]+)/) { + $name = $1; + } + if ($check_type) { if (m/^\s*}/) { $check_type = 0; @@ -60,5 +73,8 @@ while (<>) { } } } +close IN; flush(); + +printf STDERR "WARNING: keyboard name not found on %d tables at file $filename\n", $warn if ($warn);