[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-249-g3326421



The following commit has been merged in the master branch:
commit 3326421ed429e8f2a4f8016fad551a3953b7d8d8
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Tue Dec 11 11:55:24 2012 +0100

    Add json checking
    
    [nthykier:
     * minor whitespace/style issues
     * add test suite
     * relocate the basename call for better reuse
    ]
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/cruft b/checks/cruft
index efd9b7a..c57b09e 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -322,6 +322,7 @@ sub check_debfiles {
 # than creating yet a third set of tags, and this gets the severity right.
 sub find_cruft {
     my ($pkg, $info, $root, $warned, $atdinbd, $ltinbd) = @_;
+    my $basename;
     (my $name = $File::Find::name) =~ s,^$root/,,;
 
     # Ignore the .pc directory and its contents, created as part of the
@@ -349,6 +350,7 @@ sub find_cruft {
         }
     }
     -f or return; # we just need normal files for the rest
+    $basename = basename $name;
 
     unless ($warned->{$name}) {
         for my $rule (@file_checks) {
@@ -367,8 +369,7 @@ sub find_cruft {
             tag 'configure-generated-file-in-source', $name;
         }
     } elsif ($name =~ m,^(.+/)?config.(?:guess|sub)$, and not $atdinbd) {
-        my $b = basename $name;
-        open F, '<', $b or fail "can't open $name: $!";
+        open F, '<', $basename or fail "can't open $name: $!";
         while (<F>) {
             last if $. > 10; # it's on the 6th line, but be a bit more lenient
             if (/^(?:timestamp|version)='((\d+)-(\d+).*)'$/) {
@@ -388,8 +389,7 @@ sub find_cruft {
     } elsif ($name =~ m,^(.+/)?ltconfig$, and not $ltinbd) {
         tag 'ancient-libtool', $name;
     } elsif ($name =~ m,^(.+/)?ltmain\.sh$, and not $ltinbd) {
-        my $b = basename $name;
-        open F, '<', $b or fail "can't open $name: $!";
+        open F, '<', $basename or fail "can't open $name: $!";
         while (<F>) {
             if (/^VERSION=[\"\']?(1\.(\d)\.(\d+)(?:-(\d))?)/) {
                 my ($version, $major, $minor, $debian) = ($1, $2, $3, $4);
@@ -406,6 +406,18 @@ sub find_cruft {
         }
         close F;
     }
+
+    # test license problem is source file (only text file)
+    if (-T $basename) {
+        open my $F, '<', $basename or fail "can't open $name: $!";
+        while (my $line = <$F>) {
+          # json evil license
+          if ($line =~ m/Software\s+shall\s+be\s+used\s+for\s+Good\s*,?\s*not\s+Evil/i) {
+             tag 'license-problem-json-evil', $name;
+          }
+        }
+        close $F or fail "can not close opened file $name: $!"
+    }
 }
 
 1;
diff --git a/checks/cruft.desc b/checks/cruft.desc
index 3c8d31d..084354d 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -478,3 +478,11 @@ Info: The given control file uses <tt>CRLF</tt> as line terminator
  <tt>CR</tt> character in the file:
  .
  <tt>sed -i 's/\r//g' path/to/file</tt>
+
+Tag: license-problem-json-evil
+Severity: serious
+Certainty: possible
+Info: The given source file is copyrighted under the non free
+ license of json and the infamous clause:
+ The Software shall be used for Good, not Evil.
+Ref: http://wiki.debian.org/qa.debian.org/jsonevil
diff --git a/debian/changelog b/debian/changelog
index 1b5b69e..946e609 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ lintian (2.5.11) UNRELEASED; urgency=low
       - dm-upload-allowed-is-obsolete
       - field-name-typo-in-dep5-copyright
       - font-adobe-copyrighted-fragment
+      - license-problem-json-evil
       - maintainer-script-has-unexpanded-debhelper-token
       - shlibs-uses-obsolete-relation
       - untranslatable-debconf-templates
@@ -58,6 +59,8 @@ lintian (2.5.11) UNRELEASED; urgency=low
     + [RA,NT] Extend the description of the tags {outdated,ancient}-
       autotools-helper-file to mention that dh-autoreconf might be
       helpful tool.
+    + [NT] Apply patch from Bastien Roucariès to detect file licensed
+      under the "Good, not Evil"-JSON license.  (Closes: #692616)
   * checks/deb-format{,.desc}:
     + [NT] Retire data.tar.xz tag.  (Closes: #680391)
   * checks/debhelper{,.desc}:
@@ -80,7 +83,7 @@ lintian (2.5.11) UNRELEASED; urgency=low
     + [RG] Recognise smarty3 as smarty itself.
     + [NT] Consider "tasksel tasks" as a meta package.
       (Closes: #691489)
-    + [NT] Add patch from Bastien Roucaries to check for adobe font
+    + [NT] Add patch from Bastien Roucariès to check for adobe font
       license issues.  (Closes: #694328)
   * checks/group-checks{,.desc}:
     + [NT] Detect debug packages not co-installable with itself,
diff --git a/t/tests/cruft-evil-json/debian/src/evil.c b/t/tests/cruft-evil-json/debian/src/evil.c
new file mode 100644
index 0000000..e95dfd2
--- /dev/null
+++ b/t/tests/cruft-evil-json/debian/src/evil.c
@@ -0,0 +1,10 @@
+/**
+ * The non-free pet-phase in the JSON license that triggers
+ *  the Lintian tag.
+ *
+ * "The software shall be used for good, not evil"
+ */
+
+int main() {
+  return 0;
+}
diff --git a/t/tests/cruft-evil-json/desc b/t/tests/cruft-evil-json/desc
new file mode 100644
index 0000000..7a4e646
--- /dev/null
+++ b/t/tests/cruft-evil-json/desc
@@ -0,0 +1,5 @@
+Testname: cruft-evil-json
+Sequence: 6000
+Version: 1.0
+Description: Check for the "Evil JSON" license
+Test-For: license-problem-json-evil
diff --git a/t/tests/cruft-evil-json/tags b/t/tests/cruft-evil-json/tags
new file mode 100644
index 0000000..cce6a88
--- /dev/null
+++ b/t/tests/cruft-evil-json/tags
@@ -0,0 +1 @@
+E: cruft-evil-json source: license-problem-json-evil src/evil.c

-- 
Debian package checker


Reply to: