aboutsummaryrefslogtreecommitdiffstats
path: root/utils/keytable/gen_keytables.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-11-08 17:41:26 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-11-08 17:41:26 (GMT)
commitbf4e76013920e26d010d92196fec769152212be5 (patch)
tree02fed92d2e673a18c7e79699435f3f16493487d3 /utils/keytable/gen_keytables.pl
parentd1315dc672f1370df68db78dfb2747df946ba408 (diff)
gen_keytables.pl: Warn if a in-driver table is found
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'utils/keytable/gen_keytables.pl')
-rwxr-xr-xutils/keytable/gen_keytables.pl18
1 files changed, 17 insertions, 1 deletions
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 (<IN>) {
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);

Privacy Policy