Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIlya Zverev <zverik@textual.ru>2015-07-14 13:15:07 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:58:57 +0300
commitbd45b031fdffeb92b4f0a59d0595e04b62e3f2db (patch)
treee6e12be4eaa6a41b9af39c7ad5e521c7959e9ee0 /tools
parent1d595aa3e2e1919ff2af9bf1a1ce6066907fddc0 (diff)
[generator] Fix logging path, and allow path reference for PLANET
Diffstat (limited to 'tools')
-rwxr-xr-xtools/unix/generate_planet.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh
index 91733d7d16..1836ecdab8 100755
--- a/tools/unix/generate_planet.sh
+++ b/tools/unix/generate_planet.sh
@@ -112,8 +112,9 @@ set -o pipefail # Capture all errors in command chains
set -u # Fail on undefined variables
# Initialize everything. For variables with X="${X:-...}" you can override a default value
-PLANET="${PLANET:-$HOME/planet/planet-latest.o5m}"
-[ ! -r "$PLANET" -a -z "$OPT_DOWNLOAD" ] && fail "Please put planet file into $PLANET, use -U, or specify correct PLANET variable"
+PLANET="${PLANET:-$HOME/planet}"
+[ -d "$PLANET" ] && PLANET="$PLANET/planet-latest.o5m"
+[ ! -f "$PLANET" -a -z "$OPT_DOWNLOAD" ] && fail "Please put planet file into $PLANET, use -U, or specify correct PLANET variable"
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"
@@ -225,8 +226,8 @@ if [ "$MODE" == "coast" ]; then
PLANET_ABS="$(cd "$(dirname "$PLANET")"; pwd)/$(basename "$PLANET")"
(
cd "$OSMCTOOLS" # osmupdate requires osmconvert in a current directory
- ./osmupdate --drop-author --drop-version --out-o5m -v "$PLANET_ABS" "$PLANET_ABS.new.o5m" >> "$PLANET_LOG" 2>&1
- )
+ ./osmupdate --drop-author --drop-version --out-o5m -v "$PLANET_ABS" "$PLANET_ABS.new.o5m"
+ ) >> "$PLANET_LOG" 2>&1
mv "$PLANET.new.o5m" "$PLANET"
fi