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>2017-10-17 13:36:24 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-11-09 10:46:44 +0300
commit9ae5833fca4e3ad165fb31c45955ac3609274438 (patch)
treebdd2171e43b416a0b583fe3484484ad01519c63d /tools
parent649bc0f82043147d4e518b999447d2ce897342a8 (diff)
[generator] Fix two issues in generator
Diffstat (limited to 'tools')
-rwxr-xr-xtools/unix/generate_planet.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh
index 848e64671e..6de79d69b5 100755
--- a/tools/unix/generate_planet.sh
+++ b/tools/unix/generate_planet.sh
@@ -359,11 +359,15 @@ if [ "$MODE" == "coast" ]; then
if [ -n "$OPT_UPDATE" ]; then
log "STATUS" "Step 1: Updating the planet file $PLANET"
PLANET_ABS="$(cd "$(dirname "$PLANET")"; pwd)/$(basename "$PLANET")"
+ OSC_ABS="$(cd "$(dirname "$OSC")"; pwd)/$(basename "$OSC")"
(
cd "$OSMCTOOLS" # osmupdate requires osmconvert in a current directory
./osmupdate --drop-author --drop-version --out-o5m -v "$PLANET_ABS" "$PLANET_ABS.new.o5m"
- if [ -f "${OSC-}" ]; then
- ./osmconvert "$PLANET_ABS.new.o5m" "$OSC" -o="$PLANET_ABS.merged.o5m"
+ if [ -f "${OSC_ABS-}" ]; then
+ # Backup the planet first
+ mv "$PLANET_ABS" "$PLANET_ABS.backup"
+ log "WARNING" "Altering the planet file with $OSC, restore it from $PLANET_ABS.backup"
+ ./osmconvert "$PLANET_ABS.new.o5m" "$OSC_ABS" -o="$PLANET_ABS.merged.o5m"
mv -f "$PLANET_ABS.merged.o5m" "$PLANET_ABS.new.o5m"
fi
) >> "$PLANET_LOG" 2>&1