From 8f7953248f7838a7aa525505b704f22bf7ccf7f6 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 9 Dec 2022 11:19:43 +0100 Subject: [PATCH] Fix mutool check --- .ansible/group_vars/all/work.yml | 15 ++++++++++----- Dockerfiles/work/Dockerfile-5.2 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-5.3 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-5.4 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-5.5 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-5.6 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-7.0 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-7.1 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-7.2 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-7.3 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-7.4 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-8.0 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-8.1 | 30 ++++++++++++++++++++---------- Dockerfiles/work/Dockerfile-8.2 | 30 ++++++++++++++++++++---------- php_tools/mupdf-tools/install.yml | 15 ++++++++++----- 15 files changed, 280 insertions(+), 140 deletions(-) diff --git a/.ansible/group_vars/all/work.yml b/.ansible/group_vars/all/work.yml index d9d35f3..ed4cd2d 100644 --- a/.ansible/group_vars/all/work.yml +++ b/.ansible/group_vars/all/work.yml @@ -321,11 +321,16 @@ tools_available: mupdf-tools: disabled: [] check: | - echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ all: type: apt package: mupdf-tools diff --git a/Dockerfiles/work/Dockerfile-5.2 b/Dockerfiles/work/Dockerfile-5.2 index 2ee61fb..eb714e6 100644 --- a/Dockerfiles/work/Dockerfile-5.2 +++ b/Dockerfiles/work/Dockerfile-5.2 @@ -343,11 +343,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -616,11 +621,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 92908e2..0661f04 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -377,11 +377,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -687,11 +692,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index 052241d..552c425 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -400,11 +400,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -725,11 +730,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 330a5c2..654c3cb 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index fd3cbc7..980d61d 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 02c62b7..73af324 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 3392289..c166825 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index e73dc03..e228c3c 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index a7fb71c..24a62cd 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-7.4 b/Dockerfiles/work/Dockerfile-7.4 index 2f929b2..4d61c5c 100644 --- a/Dockerfiles/work/Dockerfile-7.4 +++ b/Dockerfiles/work/Dockerfile-7.4 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-8.0 b/Dockerfiles/work/Dockerfile-8.0 index e046ef3..4808727 100644 --- a/Dockerfiles/work/Dockerfile-8.0 +++ b/Dockerfiles/work/Dockerfile-8.0 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-8.1 b/Dockerfiles/work/Dockerfile-8.1 index 26f6941..c24afcf 100644 --- a/Dockerfiles/work/Dockerfile-8.1 +++ b/Dockerfiles/work/Dockerfile-8.1 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -790,11 +795,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/Dockerfiles/work/Dockerfile-8.2 b/Dockerfiles/work/Dockerfile-8.2 index 602d39f..588a862 100644 --- a/Dockerfiles/work/Dockerfile-8.2 +++ b/Dockerfiles/work/Dockerfile-8.2 @@ -416,11 +416,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true @@ -743,11 +748,16 @@ RUN set -eux \ # -------------------- (apt) mupdf-tools -------------------- RUN set -eux \ - && echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + && PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ \ && true diff --git a/php_tools/mupdf-tools/install.yml b/php_tools/mupdf-tools/install.yml index 98f6435..b1368b1 100644 --- a/php_tools/mupdf-tools/install.yml +++ b/php_tools/mupdf-tools/install.yml @@ -1,11 +1,16 @@ --- check: | - echo test > test.txt \ - && mutool create -o test.pdf test.txt \ - && file test.pdf | grep 'PDF document' \ - && rm test.txt \ - && rm test.pdf \ + PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \ + && if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \ + mutool 2>&1 | grep ^usage; \ + else \ + echo test > test.txt \ + && mutool create -o test.pdf test.txt \ + && file test.pdf | grep 'PDF document' \ + && rm test.txt \ + && rm test.pdf; \ + fi \ all: type: apt