pdfunite and ghostscript availability check for RHEL/CentOS

Bug #1871515 reported by Mitsuhiro Yoshida
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

Adding the following code, we can check pdfunite and ghostscript installation on Red Hat Enterprise Linux (RHEL) and CentOS environment.

File to modify:
export/pdf/lib.php

Line:
80

[Before]
    public static function has_pdf_combiner() {
        // Check we have a valid way to combine pdfs
        $combiner = false;
        if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
            if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
                $combiner = 'pdfunite';
            }
        }
        if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
            if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
                $combiner = 'ghostscript';
            }
        }
        return $combiner;
    }

[After]
    public static function has_pdf_combiner() {
        // Check we have a valid way to combine pdfs
        $combiner = false;
        if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
            if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
                $combiner = 'pdfunite';
            }
        }
        if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
            if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
                $combiner = 'ghostscript';
            }
        }
        if ($pgtune = exec('rpm -q poppler-utils')) {
            $combiner = 'pdfunite';
        }
        if ($pgtune = exec('rpm -q ghostscript')) {
            $combiner = 'ghostscript';
        }
        return $combiner;
    }

Tags: export
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10869

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10869
Committed: https://git.mahara.org/mahara/mahara/commit/c12c87dc466d6384113d0f2e1760064d901b9ab9
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit c12c87dc466d6384113d0f2e1760064d901b9ab9
Author: Mitsuhiro Yoshida <email address hidden>
Date: Wed Apr 8 10:54:00 2020 +0900

Bug 1871515: pdfunite and ghostscript availability check for RHEL/CentOS

Change-Id: I8627d9c42323a85d65d7a50c16ae6c54a082f956

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/10892

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10892
Committed: https://git.mahara.org/mahara/mahara/commit/9eec3edc59f1b2f747bd889f579a969e6f8d8bd3
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit 9eec3edc59f1b2f747bd889f579a969e6f8d8bd3
Author: Mitsuhiro Yoshida <email address hidden>
Date: Wed Apr 8 10:54:00 2020 +0900

Bug 1871515: pdfunite and ghostscript availability check for RHEL/CentOS

Change-Id: I8627d9c42323a85d65d7a50c16ae6c54a082f956
(cherry picked from commit c12c87dc466d6384113d0f2e1760064d901b9ab9)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.04rc1 → 20.04.0
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.