[license-reconcile] 01/01: Added support for Artistic-2.0, GPL-3 and GPL-3+ and others

2015-11-17 Thread Nicholas Bamber
This is an automated email from the git hooks/post-receive script.

periapt pushed a commit to branch master
in repository license-reconcile.

commit f68a86f11493f76c5e73e4e496dbe5c78cb5a137
Author: Nicholas Bamber 
Date:   Tue Nov 17 09:45:15 2015 +

Added support for Artistic-2.0, GPL-3 and GPL-3+ and others
---
 debian/changelog| 2 +-
 lib/Debian/LicenseReconcile/App.pm  | 4 
 lib/Debian/LicenseReconcile/LicenseCheck.pm | 8 
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 36a1369..db9c673 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ license-reconcile (0.9) UNRELEASED; urgency=medium
   * Code reviewed: bin/license-reconcile [in progress]
   * Allow file aguments to restrict activity to stated files
   * Added bash completion file
-  * Added support for Artistic-2.0, GPL-3 and GPL-3+
+  * Added support for Artistic-2.0, GPL-3 and GPL-3+ and others
   * Added --suggest-stanzas option
 
  -- Nicholas Bamber   Sat, 07 Nov 2015 23:55:16 +
diff --git a/lib/Debian/LicenseReconcile/App.pm 
b/lib/Debian/LicenseReconcile/App.pm
index 03085a3..99346e0 100644
--- a/lib/Debian/LicenseReconcile/App.pm
+++ b/lib/Debian/LicenseReconcile/App.pm
@@ -145,6 +145,10 @@ sub run {
foreach my $f (sort keys %$file_checked) {
print "Files: $f\n";
if ($self->check_copyright) {
+if (not ref $file_checked->{$f}->{copyright}) {
+print "Copyright: $file_checked->{$f}->{copyright}\n";
+next;
+}
my @copyright = @{$file_checked->{$f}->{copyright}};
if (1 == scalar @copyright) {
print "Copyright: $copyright[0]\n";
diff --git a/lib/Debian/LicenseReconcile/LicenseCheck.pm 
b/lib/Debian/LicenseReconcile/LicenseCheck.pm
index e0467b1..21512ec 100644
--- a/lib/Debian/LicenseReconcile/LicenseCheck.pm
+++ b/lib/Debian/LicenseReconcile/LicenseCheck.pm
@@ -27,6 +27,14 @@ Readonly my %LICENSE_MAPPING => (
 'Apache (v2.0)' => 'Apache-2.0',
 'GPL' => 'GPL-2',
 'GPL-2' => 'GPL-2',
+'GPL (v1)' => 'GPL-1',
+'GPL (v1 or later)' => 'GPL-1+',
+'LGPL (v2.1)' => 'LGPL-2.1',
+'LGPL (v2.1 or v3) => 'LGPL-2.1 or LGPL-3',
+'LGPL (v2 or v3)' => 'LGPL-2 or LGPL-3',
+'LGPL (v3 or later)' => 'LGPL-3+',
+'MPL (v2.0)' => 'MPL-2.0',
+'Public domain' => 'public-domain',
 'GPL (v2)' => 'GPL-2',
 'GPL (v2 or later)' => 'GPL-2+',
 'GPL (v3)' => 'GPL-3',

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/license-reconcile.git

___
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits


[license-reconcile] 01/01: Added support for Artistic-2.0, GPL-3 and GPL-3+

2015-11-16 Thread Nicholas Bamber
This is an automated email from the git hooks/post-receive script.

periapt pushed a commit to branch master
in repository license-reconcile.

commit f4850187b6dde17f3032888a8c0ba791ba1beafb
Author: Nicholas Bamber 
Date:   Mon Nov 16 12:29:04 2015 +

Added support for Artistic-2.0, GPL-3 and GPL-3+
---
 debian/changelog| 1 +
 lib/Debian/LicenseReconcile/LicenseCheck.pm | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9a36cc6..ce38cc1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,7 @@ license-reconcile (0.8) unstable; urgency=medium
   * Corrected sequence of filters and commented
   * Replaced examples directory with list of projects in the documentation
   * Updated debian/license-reconcile.yml
+  * Added support for Artistic-2.0, GPL-3 and GPL-3+
 
  -- Nicholas Bamber   Thu, 05 Nov 2015 15:44:47 +
 
diff --git a/lib/Debian/LicenseReconcile/LicenseCheck.pm 
b/lib/Debian/LicenseReconcile/LicenseCheck.pm
index b489a78..e0467b1 100644
--- a/lib/Debian/LicenseReconcile/LicenseCheck.pm
+++ b/lib/Debian/LicenseReconcile/LicenseCheck.pm
@@ -29,11 +29,14 @@ Readonly my %LICENSE_MAPPING => (
 'GPL-2' => 'GPL-2',
 'GPL (v2)' => 'GPL-2',
 'GPL (v2 or later)' => 'GPL-2+',
+'GPL (v3)' => 'GPL-3',
+'GPL (v3 or later)' => 'GPL-3+',
 'LGPL (v2)' => 'LGPL',
 'zlib/libpng' => 'zlib/libpng',
 'BSD (4 clause)' => 'BSD-4-clause',
 'BSD (2 clause)' => 'BSD-2-clause',
 'BSD (3 clause)' => 'BSD-3-clause',
+'Artistic (v2.0)' => 'Artistic-2.0',
 );
 
 Readonly my $SCRIPT => '/usr/bin/licensecheck --no-conf --text';

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/license-reconcile.git

___
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits


[license-reconcile] 01/01: Added support for Artistic-2.0, GPL-3 and GPL-3+

2015-11-16 Thread Nicholas Bamber
This is an automated email from the git hooks/post-receive script.

periapt pushed a commit to branch master
in repository license-reconcile.

commit 91f29bac653d815bf0c930de05eecca155563016
Author: Nicholas Bamber 
Date:   Mon Nov 16 17:23:45 2015 +

 Added support for Artistic-2.0, GPL-3 and GPL-3+

* Added support for Artistic-2.0, GPL-3 and GPL-3+
* Added --suggest-stanzas option
---
 bin/license-reconcile| 14 +++--
 debian/changelog |  3 +-
 debian/license-reconcile.bash-completion | 53 
 lib/Debian/LicenseReconcile/App.pm   | 27 ++--
 4 files changed, 91 insertions(+), 6 deletions(-)

diff --git a/bin/license-reconcile b/bin/license-reconcile
index 054a294..eeeb989 100755
--- a/bin/license-reconcile
+++ b/bin/license-reconcile
@@ -11,9 +11,13 @@ my $help = 0;
 
 # If this is set we don't actually report errors
 # at all, but merely succeed or fail.
-# TODO: abstract output to allow flexibility of reporting
 my $quiet = 0;
 
+# If set output suggested DEP-5 Stanzas
+my $suggest_stanzas = 0;
+
+# TODO: abstract output to allow flexibility of reporting
+
 # TODO: What's this again?
 my $display_mapping = 0;
 my $check_copyright = 1;
@@ -45,6 +49,7 @@ GetOptions(
 'config-file=s' => \$config_file,
 'changelog-file=s' => \$changelog_file,
 'check-copyright!' => \$check_copyright,
+'suggest-stanzas!' => \$suggest_stanzas,
 'filters=s@' => sub {
 shift; # name of option
 my $value = shift;
@@ -74,6 +79,7 @@ my $app = Debian::LicenseReconcile::App->new(
 filters => \@filters,
 format_spec => $format_spec,
 files  => $files,
+suggest_stanzas=> $suggest_stanzas,
 );
 exit($app->run);
 
@@ -94,7 +100,7 @@ license-reconcile - reconcile debian/copyright against source
 
 B B<--help>|B<--man>
 
-B [B<--copyright-file=>I] [B<--no-check-copyright>] 
[B<--no-format-spec>] [B<--quiet>] [B<--display-mapping>] 
[B<--directory=>I] [B<--filters=>I] 
[B<--config-file=>I] [B<--changelog-file=>I] [I]
+B [B<--copyright-file=>I] [B<--no-check-copyright>] 
[B<--suggest-stanzas>] [B<--no-format-spec>] [B<--quiet>] 
[B<--display-mapping>] [B<--directory=>I] [B<--filters=>I] [B<--config-file=>I] [B<--changelog-file=>I] 
[I]
 
 =head1 DESCRIPTION
 
@@ -241,6 +247,10 @@ The Debian changelog file which defaults to 
C. The Rules filte
 uses this to get the current version and the ChangeLog filter gets its data
 from it.
 
+=head2 B<--suggest-stanzas>
+
+If set print out the license and copyright data in DEP-5 format.
+
 =head1 Filters
 
 By default the filters are processed in the order below. Once a file has been
diff --git a/debian/changelog b/debian/changelog
index ce38cc1..36a1369 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ license-reconcile (0.9) UNRELEASED; urgency=medium
   * Code reviewed: bin/license-reconcile [in progress]
   * Allow file aguments to restrict activity to stated files
   * Added bash completion file
+  * Added support for Artistic-2.0, GPL-3 and GPL-3+
+  * Added --suggest-stanzas option
 
  -- Nicholas Bamber   Sat, 07 Nov 2015 23:55:16 +
 
@@ -25,7 +27,6 @@ license-reconcile (0.8) unstable; urgency=medium
   * Corrected sequence of filters and commented
   * Replaced examples directory with list of projects in the documentation
   * Updated debian/license-reconcile.yml
-  * Added support for Artistic-2.0, GPL-3 and GPL-3+
 
  -- Nicholas Bamber   Thu, 05 Nov 2015 15:44:47 +
 
diff --git a/debian/license-reconcile.bash-completion 
b/debian/license-reconcile.bash-completion
new file mode 100644
index 000..3ba7fa5
--- /dev/null
+++ b/debian/license-reconcile.bash-completion
@@ -0,0 +1,53 @@
+_license_reconcile()
+{
+local cur prev words cword _DC_FILE
+_init_completion || return
+
+case $prev in
+--copyright-file)
+_DC_FILE=debian/copyright
+if [[ -r $_DC_FILE && $_DC_FILE =~ ^$cur ]]
+then
+   COMPREPLY=( $_DC_FILE )
+   return 0
+fi
+ _filedir
+ return 0
+ ;;
+--changelog-file)
+_DC_FILE=debian/changelog
+if [[ -r $_DC_FILE && $_DC_FILE =~ ^$cur ]]
+then
+   COMPREPLY=( $_DC_FILE )
+   return 0
+fi
+ _filedir
+ return 0
+ ;;
+--config-file)
+_DC_FILE=debian/license-reconcile.yml
+if [[ -r $_DC_FILE && $_DC_FILE =~ ^$cur ]]
+then
+   COMPREPLY=( $_DC_FILE )
+   return 0
+fi
+ _filedir
+ return 0
+ ;;
+   --directory)
+_filedir -d
+return 0
+ ;;
+esac
+
+if [[ "$cur" == -* ]]; then
+COMPREPLY=(