[PATCH] Added rake task to verify the status of licenses in the project

Francesco Vollero fvollero at redhat.com
Mon Dec 5 18:39:42 UTC 2011


On Mon, Dec 05, 2011 at 01:24:13PM -0500, Matt Wagner wrote:
> On Mon, Dec 05, 2011 at 06:25:56PM +0100, Francesco Vollero wrote:
> > 
> > Signed-off-by: Francesco Vollero <fvollero at redhat.com>
> > ---
> >  src/lib/tasks/apache_license.rake |   16 ++++++++++++++++
> >  1 files changed, 16 insertions(+), 0 deletions(-)
> >  create mode 100644 src/lib/tasks/apache_license.rake
> > 
> > diff --git a/src/lib/tasks/apache_license.rake b/src/lib/tasks/apache_license.rake
> > new file mode 100644
> > index 0000000..4e444bd
> > --- /dev/null
> > +++ b/src/lib/tasks/apache_license.rake
> > @@ -0,0 +1,16 @@
> > +namespace :license do
> > +  desc 'Verify that every file contains apache license'
> > +
> > +  task :verify do |t|
> > +
> > +    puts "Files that contain GPL License: %d" %
> > +          (%x[find ./ -type f -iname *.rb -exec grep -qE "http://www.gnu.org/copyleft/gpl.html" {} \\; -print |wc -l])
> > +    puts "Files that does not have GPL nor ASL: %d" %
> 
> Nit: I would rephrase this to "Files that have neither GPL nor ASL"

Thanks, i've updated that :)

> 
> > +          (%x[find ./ -type f -iname *.rb \\! -exec grep -qE "Copyright|copyleft" {} \\; -print|wc -l])
> > +
> > +    puts "Files that contain Apache license: %d" %
> > +          (%x[find ./ -type f -iname *.rb -exec grep -qE "Apache License" {} \\; -print|wc -l])
> > +  end
> > +
> > +  #namespace end
> > +end
> > -- 
> > 1.7.4.4
> 
> ACK, this works fine, with a nit inline above.
> 
> I wonder if we might want to list the actual files that don't include
> licenses, rather than just giving a count? Though I suppose that might
> not be needed all that often.

Yes i can "categorize" the namespace with: files without license, or gpl.
Waiting for a feedback on that since in my version it is in this way but i think someone thought was unuseful with large files.

Cheers,
Francesco


> 
> -- Matt



More information about the aeolus-devel mailing list