[Git][reproducible-builds/diffoscope][master] Drop dependency on pdftk as it relies on GCJ, relying on the pdftotext fallback. (Closes: #893702)

Chris Lamb gitlab at salsa.debian.org
Sat Jun 16 20:33:08 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
5530623e by Chris Lamb at 2018-06-16T20:28:26+02:00
Drop dependency on pdftk as it relies on GCJ, relying on the pdftotext fallback. (Closes: #893702)

- - - - -


5 changed files:

- debian/control
- diffoscope/comparators/pdf.py
- diffoscope/external_tools.py
- tests/comparators/test_pdf.py
- − tests/data/pdf_internal_expected_diff


Changes:

=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -45,7 +45,6 @@ Build-Depends:
  odt2txt <!nocheck>,
  oggvideotools <!nocheck>,
  openssh-client <!nocheck>,
- pdftk <!nocheck>,
  pgpdump <!nocheck>,
  poppler-utils <!nocheck>,
  python-argcomplete,


=====================================
diffoscope/comparators/pdf.py
=====================================
--- a/diffoscope/comparators/pdf.py
+++ b/diffoscope/comparators/pdf.py
@@ -32,19 +32,9 @@ class Pdftotext(Command):
         return ['pdftotext', self.path, '-']
 
 
-class Pdftk(Command):
-    @tool_required('pdftk')
-    def cmdline(self):
-        return ['pdftk', self.path, 'output', '-', 'uncompress']
-
-    def filter(self, line):
-        return line.decode('latin-1').encode('utf-8')
-
-
 class PdfFile(File):
     DESCRIPTION = "PDF documents"
     FILE_TYPE_RE = re.compile(r'^PDF document\b')
 
     def compare_details(self, other, source=None):
-        return [Difference.from_command(Pdftotext, self.path, other.path),
-                Difference.from_command(Pdftk, self.path, other.path)]
+        return [Difference.from_command(Pdftotext, self.path, other.path)]


=====================================
diffoscope/external_tools.py
=====================================
--- a/diffoscope/external_tools.py
+++ b/diffoscope/external_tools.py
@@ -177,10 +177,6 @@ EXTERNAL_TOOLS = {
         'debian': 'pgpdump',
         'arch': 'pgpdump',
     },
-    'pdftk': {
-        'debian': 'pdftk',
-        'FreeBSD': 'pdftk',
-    },
     'pdftotext': {
         'debian': 'poppler-utils',
         'arch': 'poppler',


=====================================
tests/comparators/test_pdf.py
=====================================
--- a/tests/comparators/test_pdf.py
+++ b/tests/comparators/test_pdf.py
@@ -52,18 +52,12 @@ def differences(pdf1, pdf2):
     return pdf1.compare(pdf2).details
 
 
- at skip_unless_tools_exist('pdftk', 'pdftotext')
+ at skip_unless_tools_exist('pdftotext')
 def test_text_diff(differences):
     expected_diff = get_data('pdf_text_expected_diff')
     assert differences[0].unified_diff == expected_diff
 
 
- at skip_unless_tools_exist('pdftk', 'pdftotext')
-def test_internal_diff(differences):
-    expected_diff = get_data('pdf_internal_expected_diff')
-    assert differences[1].unified_diff == expected_diff
-
-
- at skip_unless_tools_exist('pdftk', 'pdftotext')
+ at skip_unless_tools_exist('pdftotext')
 def test_compare_non_existing(monkeypatch, pdf1):
     assert_non_existing(monkeypatch, pdf1, has_null_source=False)


=====================================
tests/data/pdf_internal_expected_diff deleted
=====================================
--- a/tests/data/pdf_internal_expected_diff
+++ /dev/null
@@ -1,52 +0,0 @@
-@@ -11,23 +11,23 @@
- /Kids [3 0 R]
- /Type /Pages
- /Count 1
- >>
- endobj 
- 4 0 obj 
- <<
--/Length 85
-+/Length 109
- >>
- stream
- q
- 
- BT
- 36.0 747.384 Td
- /F1.0 12 Tf
--[<48656c6c6f2057> 30 <6f72> -15 <6c6421>] TJ
-+[<48656c6c6f20536963> 20 <6b205361642057> 30 <6f72> -15 <6c6421>] TJ
- ET
- 
- Q
- 
- endstream 
- endobj 
- 3 0 obj 
-@@ -61,21 +61,21 @@
- /Producer <feff0050007200610077006e>
- >>
- endobj xref
- 0 7
- 0000000000 65535 f 
- 0000000015 00000 n 
- 0000000066 00000 n 
--0000000263 00000 n 
-+0000000288 00000 n 
- 0000000125 00000 n 
--0000000462 00000 n 
--0000000561 00000 n 
-+0000000487 00000 n 
-+0000000586 00000 n 
- trailer
- 
- <<
- /Info 6 0 R
- /Root 1 0 R
- /Size 7
- >>
- startxref
--656
-+681
- %%EOF



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/5530623e9672c8afa4f186303bba29232b28ccd6

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/5530623e9672c8afa4f186303bba29232b28ccd6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180616/8944c4a6/attachment.html>


More information about the rb-commits mailing list