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

Bug#298545: lintian check for non-free font-files?



Package: lintian
Version: 1.23.8
Severity: wishlist
Tags: patch

hi,

im not sure if this is lintian's job. However, it would be nice if
lintian would check for fonts which are considered non-free (for
example by using the usual filenames like `verdana.ttf').

Attached, a quick hack.

bye,
    - michael
diff -ruN lintian-1.23.8.orig/checks/files ../lintian/lintian-1.23.8/checks/files
--- lintian-1.23.8.orig/checks/files	2005-01-14 22:34:52.000000000 +0100
+++ ../lintian/lintian-1.23.8/checks/files	2005-03-08 13:31:21.000000000 +0100
@@ -30,6 +30,7 @@
 
 my $file;
 my $source_pkg;
+my $section;
 my $is_python;
 my $is_perl;
 my $has_binary_perl_file;
@@ -61,6 +62,11 @@
     chomp ($source_pkg = (<SOURCE> || ""));
 }
 
+#Get Section of package.
+if (open (SECTION, "fields/section")) {
+    chomp ($section = (<SECTION> || ""));
+}
+
 # find out which files are scripts
 open(SCRIPTS, "scripts") or fail("cannot open lintian scripts file: $!");
 while (<SCRIPTS>) {
@@ -454,6 +460,14 @@
 	tag "extra-license-file", "$file";
     }
 
+    my @badfonts = ("verdana.ttf", "lucida_unicode.ttf", "vixar.ttf");
+    # ---------------- check for illegal fonts if Package section is not
+    #                  non-free
+    if( $section !~ /^non-free/ ) {
+        foreach my $font (@badfonts) {
+            tag "contains-bad-font", "$file" if $file =~ /$font$/;
+        } 
+    }
 
     # ---------------- plain files
     if ($perm =~ m/^-/) {
diff -ruN lintian-1.23.8.orig/checks/files.desc ../lintian/lintian-1.23.8/checks/files.desc
--- lintian-1.23.8.orig/checks/files.desc	2005-01-14 22:34:51.000000000 +0100
+++ ../lintian/lintian-1.23.8/checks/files.desc	2005-03-08 13:31:09.000000000 +0100
@@ -495,3 +495,9 @@
  files that are intended to create a menu should be placed in 
  <tt>/usr/share/applications/</tt>, and no longer in
  <tt>/usr/share/gnome/apps</tt> or <tt>/usr/share/applnk</tt>
+
+Tag: contains-bad-font
+Type: warning
+Info: package contains non-free font, but section is main.
+ These files should be removed if the package goes into
+ the `main'-Section.

Reply to: