From 8301204cc0736e436d1946231cf0842fac7918f7 Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Mon, 2 Dec 2024 03:04:03 -0500 Subject: [PATCH] Stirling-PDF: replace dependency for v0.35.0 and add check and fix in stirling-pdf.sh (#614) * Add check for old dependency in update_script function for stirling-pdf.sh Checks if ocrmypdf is installed and qpdf is not; if true then removes ocrmypdf and installs qpdf * Replace ocrmypdf with qpdf as dependency in stirling-pdf-install.sh As of v0.35.0, StirlingPDF now uses qpdf for OCR instead of ocrmypdf. --- ct/stirling-pdf.sh | 4 ++++ install/stirling-pdf-install.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ct/stirling-pdf.sh b/ct/stirling-pdf.sh index 67eaee05..e78ec23c 100644 --- a/ct/stirling-pdf.sh +++ b/ct/stirling-pdf.sh @@ -59,6 +59,10 @@ check_container_resources if [[ ! -d /opt/Stirling-PDF ]]; then msg_error "No ${APP} Installation Found!"; exit; fi msg_info "Updating ${APP}" systemctl stop stirlingpdf +if [[ -n $(dpkg -l | grep -w ocrmypdf) ]] && [[ -z $(dpkg -l | grep -w qpdf) ]]; then + apt-get remove -y ocrmypdf &>/dev/null + apt-get install -y qpdf &>/dev/null +fi RELEASE=$(curl -s https://api.github.com/repos/Stirling-Tools/Stirling-PDF/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') wget -q https://github.com/Stirling-Tools/Stirling-PDF/archive/refs/tags/v$RELEASE.tar.gz tar -xzf v$RELEASE.tar.gz diff --git a/install/stirling-pdf-install.sh b/install/stirling-pdf-install.sh index 6b4a8d51..3e373373 100644 --- a/install/stirling-pdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -28,7 +28,7 @@ $STD apt-get install -y \ make \ g++ \ unpaper \ - ocrmypdf \ + qpdf \ poppler-utils msg_ok "Installed Dependencies"