Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] keytable: Add source information in generated keymaps
@ 2021-01-26 17:45 Bastien Nocera
  2021-03-06 14:49 ` Sean Young
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2021-01-26 17:45 UTC (permalink / raw)
  To: linux-media; +Cc: Bastien Nocera

Add comments to mention that keymap files are generated, and list which
tool was used to generate them and the kernel source filename.

This should make it less likely that generated files are used as
examples to contribute keymaps from, and more likely that upstream
changes are channeled through the right source tree.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 utils/keytable/gen_keytables.pl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl
index c14aded3..40556479 100755
--- a/utils/keytable/gen_keytables.pl
+++ b/utils/keytable/gen_keytables.pl
@@ -36,10 +36,15 @@ sub flush($$)
 	my $filename = shift;
 	my $legacy = shift;
 	my $defined;
+	my $relative_filename = $filename;
 
 	return if (!$keyname || !$out);
-	print "Creating $dir/$keyname.toml\n";
+	$relative_filename =~ s/^$kernel_dir//;
+	$relative_filename =~ s/^\///;
+	print "Creating $dir/$keyname.toml from $relative_filename\n";
 	open OUT, ">$dir/$keyname.toml";
+	print OUT "# Generated with gen_keytables.pl in v4l-utils\n";
+	print OUT "# using $relative_filename as a source file\n";
 	print OUT "[[protocols]]\n";
 	print OUT "name = \"$keyname\"\n";
 	print OUT "protocol = \"$type\"\n";
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-07 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-26 17:45 [PATCH] keytable: Add source information in generated keymaps Bastien Nocera
2021-03-06 14:49 ` Sean Young
2021-03-06 15:26   ` Bastien Nocera
2021-03-06 15:34     ` Sean Young
2021-03-07 10:25       ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox