Whoops
[llpp.git] / misc / getmupdf.sh
blob6d9447117d8cbcdd772bafd8cac45f4b46c09d0a
1 #!/bin/sh
2 set -eu
4 MUPDF_OUTPUT_DIR="$1"
5 MUPDF_URL="https://github.com/ArtifexSoftware/mupdf"
6 MUPDF_DESIRED_VERSION="b330704579c6ae6af9bda24b375a98cdcb55d6d9"
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