diff options
author | Ilya Zverev <zverik@textual.ru> | 2015-08-11 12:36:09 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:00:59 +0300 |
commit | ac36b25a783d35bc0f6ba9abaa6fea2eb6bde99b (patch) | |
tree | 8441e8a3a958a2ef329f9fb13b85ce99406df9b0 /tools | |
parent | 92ff9e774ce52d6c8efa5f410f226097de151846 (diff) |
[generator] Open more options in generate_mwm
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/unix/find_generator_tool.sh | 4 | ||||
-rwxr-xr-x | tools/unix/generate_mwm.sh | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/unix/find_generator_tool.sh b/tools/unix/find_generator_tool.sh index d29963fc00..9298325d6e 100755 --- a/tools/unix/find_generator_tool.sh +++ b/tools/unix/find_generator_tool.sh @@ -8,7 +8,7 @@ OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}" -if [ -z "${GENERATOR_TOOL-}" ]; then +if [ -z "${GENERATOR_TOOL-}" -o ! -x "${GENERATOR_TOOL-}" ]; then IT_PATHS_ARRAY=() for i in ${BUILD_PATH-} $OMIM_PATH $OMIM_PATH/../*omim*elease* $OMIM_PATH/../*omim*ebug; do if [ -d "$i/out" ]; then @@ -24,5 +24,5 @@ if [ -z "${GENERATOR_TOOL-}" ]; then done fi -[ -z ${GENERATOR_TOOL-} -o ! -x "${GENERATOR_TOOL-}" ] && fail "No generator_tool found in ${IT_PATHS_ARRAY[*]}" +[ -z ${GENERATOR_TOOL-} -o ! -x "${GENERATOR_TOOL-}" ] && fail "No generator_tool found in ${IT_PATHS_ARRAY[*]-${GENERATOR_TOOL-}}" echo "Using tool: $GENERATOR_TOOL" diff --git a/tools/unix/generate_mwm.sh b/tools/unix/generate_mwm.sh index 6ed81c7e51..d49f8cb503 100755 --- a/tools/unix/generate_mwm.sh +++ b/tools/unix/generate_mwm.sh @@ -16,6 +16,7 @@ # the source file to be one of the pre-defined countries. set -u +set -e if [ $# -lt 1 ]; then echo @@ -53,10 +54,13 @@ TARGET="${TARGET:-$(dirname "$SOURCE_FILE")}" [ ! -d "$TARGET" ] && fail "$TARGET should be a writable folder" TBORDERS="$TARGET/borders" OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}" -DATA_PATH="$OMIM_PATH/data/" -[ ! -r "${DATA_PATH}types.txt" ] && fail "Cannot find classificators in $DATA_PATH, please set correct OMIM_PATH" +DATA_PATH="${DATA_PATH:-$OMIM_PATH/data}" +[ ! -r "$DATA_PATH/types.txt" ] && fail "Cannot find classificators in $DATA_PATH, please set correct OMIM_PATH" -source find_generator_tool.sh +GENERATOR_TOOL="${GENERATOR_TOOL-$(dirname "$0")/bin/generator_tool}" +FIND_GEN_TOOL="$(dirname "$0")/find_generator_tool.sh" +[ -x "$FIND_GEN_TOOL" ] && source "$FIND_GEN_TOOL" +[ ! -x "${GENERATOR_TOOL-}" ] && fail "Cannot find generator tool" if [ "$(uname)" == "Darwin" ]; then INTDIR=$(mktemp -d -t mwmgen) @@ -106,6 +110,7 @@ if [ $# -gt 1 ]; then # Create .mwm.routing file OSRM_PATH="${OSRM_PATH:-$OMIM_PATH/3party/osrm/osrm-backend}" OSRM_BUILD_PATH="${OSRM_BUILD_PATH:-$OSRM_PATH/build}" + [ ! -x "$OSRM_BUILD_PATH/osrm-extract" -a -x "$(dirname "$0")/bin/osrm-extract" ] && OSRM_BUILD_PATH="$(dirname "$0")/bin" [ ! -x "$OSRM_BUILD_PATH/osrm-extract" ] && fail "Please compile OSRM binaries to $OSRM_BUILD_PATH" [ ! -r "$TARGET/$BASE_NAME.mwm" ] && fail "Please build mwm file beforehand" |