mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	 Ingo Molnar <mingo@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Philippe Ombredanne <pombredanne@nexb.com>
Subject: Re: [patch 0/4] genirq: Clean up license information
Date: Thu, 15 Mar 2018 10:35:07 -0700	[thread overview]
Message-ID: <1521135307.22221.42.camel@perches.com> (raw)
In-Reply-To: <20180315172343.GA28917@kroah.com>

On Thu, 2018-03-15 at 18:23 +0100, Greg Kroah-Hartman wrote:
> On Thu, Mar 15, 2018 at 08:00:18AM -0700, Joe Perches wrote:
> > On Wed, 2018-03-14 at 22:15 +0100, Thomas Gleixner wrote:
> > > The following patch series cleans up the licensing information in the
> > > generic irq subsystem.
> > > 
> > >   * Replace boiler plate language and sloppy references with SPDX
> > > 
> > >   * Add missing SPDX identifiers to files with no license reference
> > > 
> > >   * Use the proper tag format
> > > 
> > > While at it clean up the top of file comments by removing pointless
> > > references to the filename itself and condense the information where
> > > appropriate.
> > 
> > Hello.
> > 
> > What do you think of the proposal to convert all the tags
> > to the "-or-later" and "-only" variants that the
> > https://spdx.org/licenses/ uses today?
> 
> Ick ick ick ick.  Let's stick with what we have today, if we do decide
> to do this type of foolishness,

Why would it be foolish to have the kernel
match the spdx license text?

> we can do it all in one simple script to
> email to Linus to run on his tree.

I sent that script Feb 8.

Here it is again:
---
#!/bin/bash

license_script=$(mktemp -t convert-SPDX-licenses.XXXXXXXXX.pl)
cat <<'EOF' >> $license_script

our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/;

sub deparenthesize {
	my ($string) = @_;

	return "" if (!defined($string));

	while ($string =~ /^\s*\(.*\)\s*$/) {
		$string =~ s@^\s*\(\s*@@;
		$string =~ s@\s*\)\s*$@@;
	}

	return $string;
}

for my $filename (@ARGV) {
	my $FILE;

	if ($filename eq '-') {
		open($FILE, '<&STDIN');
	} else {
		open($FILE, '<', "$filename") ||
			die "$P: $filename: open failed - $!\n";
	}
	undef $/;
	my $file = <$FILE>;
	close $FILE;

	my $spdx = "SPDX-License-Identifier:";

	$file =~ s/\b$spdx[ \t]*((?:\([ \t]*)*)GPL(\d\.\d)/$spdx \1GPL-\2/g;
	$file =~ s/\b$spdx[ \t]*((?:\([ \t]*)*)(L?GPL-\d\.\d)\+/$spdx \1\2-or-later/g;
	$file =~ s/\b$spdx[ \t]*((?:\([ \t]*)*)(L?GPL-\d\.\d)(?!-or-later|-only)/$spdx \1\2-only/g;

	while ($file =~ s/\b$spdx[ \t]($balanced_parens)(?![ \t]*AND|[ \t]*OR)/$spdx . ' ' . deparenthesize($1)/ex) {
		;
	}

	if ($filename eq '-') {
		open($FILE, '>&STDOUT');
	} else {
		open($FILE, '>', "$filename") ||
			die "$P: $filename: open failed - $!\n";
	}
	print $FILE $file;
	close $FILE;
}
EOF

git grep --name-only "$spdx" | \
    grep -vP "^(?:LICENSES/|Documentation/process/license-rules\.rst)" | \
    xargs perl $license_script

rm -f $license_script

      reply	other threads:[~2018-03-15 17:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 21:15 Thomas Gleixner
2018-03-14 21:15 ` [patch 1/4] genirq: Cleanup top of file comments Thomas Gleixner
2018-03-20 13:27   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2018-03-14 21:15 ` [patch 2/4] genirq/matrix: Cleanup SPDX identifier Thomas Gleixner
2018-03-20 13:28   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2018-03-14 21:15 ` [patch 3/4] genirq: Convert various GPL references to SPDX Thomas Gleixner
2018-03-15  7:44   ` Daniel Lezcano
2018-03-14 21:15 ` [patch 4/4] genirq: Add missing SPDX identifiers Thomas Gleixner
2018-03-20 13:28   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2018-03-20 13:29   ` [tip:irq/core] genirq: Remove license boilerplate/references tip-bot for Thomas Gleixner
2018-03-15 10:46 ` [patch 0/4] genirq: Clean up license information Marc Zyngier
2018-03-15 15:00 ` Joe Perches
2018-03-15 17:23   ` Greg Kroah-Hartman
2018-03-15 17:35     ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1521135307.22221.42.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome