Commit 5530623e authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Drop dependency on pdftk as it relies on GCJ, relying on the pdftotext fallback. (Closes: #893702)

parent bac105b9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ Build-Depends:
 odt2txt <!nocheck>,
 oggvideotools <!nocheck>,
 openssh-client <!nocheck>,
 pdftk <!nocheck>,
 pgpdump <!nocheck>,
 poppler-utils <!nocheck>,
 python-argcomplete,
+1 −11
Original line number Diff line number Diff line
@@ -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)]
+0 −4
Original line number Diff line number Diff line
@@ -177,10 +177,6 @@ EXTERNAL_TOOLS = {
        'debian': 'pgpdump',
        'arch': 'pgpdump',
    },
    'pdftk': {
        'debian': 'pdftk',
        'FreeBSD': 'pdftk',
    },
    'pdftotext': {
        'debian': 'poppler-utils',
        'arch': 'poppler',
+2 −8
Original line number Diff line number Diff line
@@ -52,18 +52,12 @@ def differences(pdf1, pdf2):
    return pdf1.compare(pdf2).details


@skip_unless_tools_exist('pdftk', 'pdftotext')
@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


@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


@skip_unless_tools_exist('pdftk', 'pdftotext')
@skip_unless_tools_exist('pdftotext')
def test_compare_non_existing(monkeypatch, pdf1):
    assert_non_existing(monkeypatch, pdf1, has_null_source=False)
+0 −52
Original line number Diff line number Diff line
@@ -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