Fix mutool check

This commit is contained in:
cytopia
2022-12-09 11:19:43 +01:00
parent 30c3118a22
commit 8f7953248f
15 changed files with 280 additions and 140 deletions

View File

@@ -321,11 +321,16 @@ tools_available:
mupdf-tools:
disabled: []
check: |
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 \
&& rm test.pdf; \
fi \
all:
type: apt
package: mupdf-tools

View File

@@ -343,11 +343,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -616,11 +621,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -377,11 +377,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -687,11 +692,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -400,11 +400,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -725,11 +730,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -790,11 +795,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -416,11 +416,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true
@@ -743,11 +748,16 @@ RUN set -eux \
# -------------------- (apt) mupdf-tools --------------------
RUN set -eux \
&& echo test > test.txt \
&& 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 \
&& rm test.pdf; \
fi \
\
&& true

View File

@@ -1,11 +1,16 @@
---
check: |
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 \
&& rm test.pdf; \
fi \
all:
type: apt