Package: lintian
Version: 2.5.50.4
Severity: normal
Tags: patch

Dear Maintainer,

The codeless-jar check expects a jar to contain .class and/or .clj 
files. Clojure Reader Conditionals[1], introduced in Clojure 1.7, rely 
on a new file extension (.cljc) which lintian should also count as code.  
Otherwise, jars containing only .cljc files are erroneously reported as 
"codeless".

The attached patch fixes this.

[1] https://clojure.org/guides/reader_conditionals 

Regards,
Apollon
>From 7d51503e8834c85b727da9a6fbf726e27ebe0abc Mon Sep 17 00:00:00 2001
From: Apollon Oikonomopoulos <apoi...@debian.org>
Date: Thu, 3 Aug 2017 15:40:16 -0400
Subject: [PATCH] c/java.pm: handle .cljc when looking for code

Clojure >= 1.7 supports the so-called "reader conditionals" which allow
different dialects of Clojure to share common code[1]. Reader
conditionals add a new class of code files (.cljc) which lintian should
know about.

[1] https://clojure.org/guides/reader_conditionals
---
 checks/java.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/checks/java.pm b/checks/java.pm
index e8a55be94..83bd97085 100644
--- a/checks/java.pm
+++ b/checks/java.pm
@@ -79,10 +79,10 @@ sub run {
             $has_public_jars = 1;
         }
         # check for common code files like .class or .clj (Clojure files)
-        foreach my $class (grep { m/\.(?:class|clj)$/oi } sort keys %{$files}){
+        foreach my $class (grep { m/\.(?:class|cljc?)$/oi } sort keys %{$files}){
             my $mver = $files->{$class};
             $classes = 1;
-            next if $class =~ m/\.clj$/;
+            next if $class =~ m/\.cljc?$/;
             # .class but no major version?
             next if $mver eq '-';
             if (   $mver <= $MAX_BYTECODE->value('min-bytecode-version') - 1
-- 
2.11.0

Reply via email to