Sync with upstream
[llpp.git] / misc / getmupdf.sh
blobbed0c2c1274fa61b16f7025f80672c58b1c2aaac
1 #!/bin/sh
2 set -eu
4 MUPDF_OUTPUT_DIR="$1"
5 MUPDF_URL="https://github.com/ArtifexSoftware/mupdf"
6 MUPDF_DESIRED_VERSION="a64b8e6c4a26b4e73e96f9b922969c37989acf59"
8 if [ ! -d ${MUPDF_OUTPUT_DIR} ]; then
9 echo "mupdf does not exist, fetching it from ${MUPDF_URL}"
10 git clone ${cloneargs-} ${MUPDF_URL} --recursive ${MUPDF_OUTPUT_DIR}
13 cd ${MUPDF_OUTPUT_DIR}
14 git remote update
15 MUPDF_VERSION=$(git rev-parse HEAD)
17 test "${MUPDF_VERSION}" = "${MUPDF_DESIRED_VERSION}" || {
18 printf "mupdf current version is ${MUPDF_VERSION} "
19 echo "switching to ${MUPDF_DESIRED_VERSION}"
20 git reset --hard ${MUPDF_DESIRED_VERSION}
21 git submodule update --init --recursive