Bug#705175: [lintian] Add more detection for adobe non free fonts problem
Package: lintian
Version: 2.5.10.3
Severity: wishlist
Tags: patch
Detect adobe copyright fragment even wihtout adobe copyright line.
Indeed startlock primitive is only documented under the copyrighted block fragment of adobe.
PS: I plan to pass to 8000tags emitted to 16000 ;)
From 44405a9cebcb5805b5afa4f25232a7cbb2035cb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Thu, 11 Apr 2013 00:09:55 +0200
Subject: [PATCH] Add test for adobe font fragment
---
checks/files | 7 +++++++
checks/files.desc | 13 +++++++++++++
t/tests/files-adobe-font/debian/Makefile | 2 +-
t/tests/files-adobe-font/debian/badnocredit.raw | 15 +++++++++++++++
t/tests/files-adobe-font/debian/badwithadobecode.raw | 17 +++++++++++++++++
t/tests/files-adobe-font/tags | 2 ++
6 files changed, 55 insertions(+), 1 deletion(-)
create mode 100644 t/tests/files-adobe-font/debian/badnocredit.raw
create mode 100644 t/tests/files-adobe-font/debian/badwithadobecode.raw
diff --git a/checks/files b/checks/files
index 6a76f5f..5ba18c8 100644
--- a/checks/files
+++ b/checks/files
@@ -1051,6 +1051,13 @@ foreach my $file ($info->sorted_index) {
if ($line =~ m/^[%\s]*Copyright\s*\(c\)\s*19\d{2}[\-\s]19\d{2}\s*Adobe\s*Systems\s*Incorporated\.?\s*$/i) {
$foundadobeline = 1;
}
+ # If copy pasted from black book they are copyright adobe a few line before
+ # the only place where the startlock is documented is in the black book
+ # copyrighted fragment
+ if ($line =~ m/startlock\s*get\s*exec/) {
+ tag 'font-adobe-copyrighted-fragment-no-credit', $file;
+ last;
+ }
}
close $t1pipe or fail "could not close pipe: $! $?";
}
diff --git a/checks/files.desc b/checks/files.desc
index cb739bb..0e47660 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -979,6 +979,19 @@ Info: This type 1 font file includes some postscript fragment with a
Should this be a false-positive, please override the tag.
Ref: http://wiki.debian.org/qa.debian.org/type1nondfsg
+Tag: font-adobe-copyrighted-fragment-no-credit
+Severity: serious
+Certainty: possible
+Info: This type 1 font file includes some postscript fragment with a
+ non free license of Adobe. In order to check if this tag is genuine
+ please follow the proceedure described in the reference.
+ .
+ Moreover the fragment was likely verbatim copied from black
+ book without any credit to Adobe.
+ .
+ Should this be a false-positive, please override the tag.
+Ref: http://wiki.debian.org/qa.debian.org/type1nondfsg
+
Tag: duplicate-font-file
Severity: normal
Certainty: possible
diff --git a/t/tests/files-adobe-font/debian/Makefile b/t/tests/files-adobe-font/debian/Makefile
index 79c39ed..6b48449 100644
--- a/t/tests/files-adobe-font/debian/Makefile
+++ b/t/tests/files-adobe-font/debian/Makefile
@@ -1,4 +1,4 @@
-all: bad.pfb good.pfb
+all: bad.pfb good.pfb badnocredit.pfb badwithadobecode.pfb
%.pfb: %.raw
t1asm $< > $@
diff --git a/t/tests/files-adobe-font/debian/badnocredit.raw b/t/tests/files-adobe-font/debian/badnocredit.raw
new file mode 100644
index 0000000..a3654c9
--- /dev/null
+++ b/t/tests/files-adobe-font/debian/badnocredit.raw
@@ -0,0 +1,15 @@
+%!PS-AdobeFont-1.0: Untitled1 001.000
+%%Title: bad
+%Version: 001.000
+%%CreationDate: Mon Dec 10 21:21:58 2012
+%%Creator: nthykier,,,
+%Copyright: Created by nthykier,,, hand-crafted
+%%EndComments
+
+/RD{string currentfile exch readstring pop}executeonly def
+
+% Below is here to trick Lintian...
+trick { /startlock get exec } def
+
+2 index /CharStrings 2 dict dup begin
+
diff --git a/t/tests/files-adobe-font/debian/badwithadobecode.raw b/t/tests/files-adobe-font/debian/badwithadobecode.raw
new file mode 100644
index 0000000..22fca3b
--- /dev/null
+++ b/t/tests/files-adobe-font/debian/badwithadobecode.raw
@@ -0,0 +1,17 @@
+%!PS-AdobeFont-1.0: Untitled1 001.000
+%%Title: bad
+%Version: 001.000
+%%CreationDate: Mon Dec 10 21:21:58 2012
+%%Creator: nthykier,,,
+%Copyright: Created by nthykier,,, hand-crafted
+%%EndComments
+
+/RD{string currentfile exch readstring pop}executeonly def
+
+% Below is here to trick Lintian...
+% Copyright (c) 1987-1990 Adobe Systems Incorporated.
+% All Rights Reserved.
+trick { /startlock get exec } def
+
+2 index /CharStrings 2 dict dup begin
+
diff --git a/t/tests/files-adobe-font/tags b/t/tests/files-adobe-font/tags
index 6a6bd8d..ded07f3 100644
--- a/t/tests/files-adobe-font/tags
+++ b/t/tests/files-adobe-font/tags
@@ -1 +1,3 @@
E: fonts-files-adobe-font: font-adobe-copyrighted-fragment usr/share/lintian/fonts/bad.pfb
+E: fonts-files-adobe-font: font-adobe-copyrighted-fragment usr/share/lintian/fonts/badwithadobecode.pfb
+E: fonts-files-adobe-font: font-adobe-copyrighted-fragment-no-credit usr/share/lintian/fonts/badnocredit.pfb
--
1.7.10.4
Reply to: