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

* Re: [PATCH] keytable: Add source information in generated keymaps
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Sean Young @ 2021-03-06 14:49 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-media

On Tue, Jan 26, 2021 at 06:45:14PM +0100, Bastien Nocera wrote:
> 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";

So on second thought, this is a good idea. How would feel about
shortening it to one line, like:

	print OUT "# Generated with gen_keytables.pl from $relative_filename\n";

Thanks

Sean

>  	print OUT "[[protocols]]\n";
>  	print OUT "name = \"$keyname\"\n";
>  	print OUT "protocol = \"$type\"\n";
> -- 
> 2.29.2

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

* Re: [PATCH] keytable: Add source information in generated keymaps
  2021-03-06 14:49 ` Sean Young
@ 2021-03-06 15:26   ` Bastien Nocera
  2021-03-06 15:34     ` Sean Young
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2021-03-06 15:26 UTC (permalink / raw)
  To: Sean Young; +Cc: linux-media

On Sat, 2021-03-06 at 14:49 +0000, Sean Young wrote:
> On Tue, Jan 26, 2021 at 06:45:14PM +0100, Bastien Nocera wrote:
> > 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";
> 
> So on second thought, this is a good idea. How would feel about
> shortening it to one line, like:
> 
>         print OUT "# Generated with gen_keytables.pl from
> $relative_filename\n";

That would be fine, yes. Feel free to amend the wording to your liking
with my SoB.

Cheers

> 
> Thanks
> 
> Sean
> 
> >         print OUT "[[protocols]]\n";
> >         print OUT "name = \"$keyname\"\n";
> >         print OUT "protocol = \"$type\"\n";
> > -- 
> > 2.29.2



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

* Re: [PATCH] keytable: Add source information in generated keymaps
  2021-03-06 15:26   ` Bastien Nocera
@ 2021-03-06 15:34     ` Sean Young
  2021-03-07 10:25       ` Bastien Nocera
  0 siblings, 1 reply; 5+ messages in thread
From: Sean Young @ 2021-03-06 15:34 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-media

On Sat, Mar 06, 2021 at 04:26:53PM +0100, Bastien Nocera wrote:
> On Sat, 2021-03-06 at 14:49 +0000, Sean Young wrote:
> > On Tue, Jan 26, 2021 at 06:45:14PM +0100, Bastien Nocera wrote:
> > > 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";
> > 
> > So on second thought, this is a good idea. How would feel about
> > shortening it to one line, like:
> > 
> >         print OUT "# Generated with gen_keytables.pl from
> > $relative_filename\n";
> 
> That would be fine, yes. Feel free to amend the wording to your liking
> with my SoB.

Thanks -- patch applied

Do you want to fix the rc protocol in the Dell RC 260 keymap and apply?


Sean


> 
> Cheers
> 
> > 
> > Thanks
> > 
> > Sean
> > 
> > >         print OUT "[[protocols]]\n";
> > >         print OUT "name = \"$keyname\"\n";
> > >         print OUT "protocol = \"$type\"\n";
> > > -- 
> > > 2.29.2
> 

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

* Re: [PATCH] keytable: Add source information in generated keymaps
  2021-03-06 15:34     ` Sean Young
@ 2021-03-07 10:25       ` Bastien Nocera
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2021-03-07 10:25 UTC (permalink / raw)
  To: Sean Young; +Cc: linux-media

On Sat, 2021-03-06 at 15:34 +0000, Sean Young wrote:
> On Sat, Mar 06, 2021 at 04:26:53PM +0100, Bastien Nocera wrote:
> > On Sat, 2021-03-06 at 14:49 +0000, Sean Young wrote:
> > > On Tue, Jan 26, 2021 at 06:45:14PM +0100, Bastien Nocera wrote:
> > > > 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";
> > > 
> > > So on second thought, this is a good idea. How would feel about
> > > shortening it to one line, like:
> > > 
> > >         print OUT "# Generated with gen_keytables.pl from
> > > $relative_filename\n";
> > 
> > That would be fine, yes. Feel free to amend the wording to your
> > liking
> > with my SoB.
> 
> Thanks -- patch applied
> 
> Do you want to fix the rc protocol in the Dell RC 260 keymap and
> apply?

I haven't had the time to modify the patch and fix it, probably next
week.

Cheers


^ permalink raw reply	[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