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:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-10-10 16:10:28 +0300
committerYuri Gorshenin <mipt.vi002@gmail.com>2017-10-10 16:32:21 +0300
commit8ebfcc559ece0472d828d1b0e7a08df3867d1c55 (patch)
treedc0590a10f96b47502ac4698943984928a6fef4a /tools
parentb222a8a12ed91fd954b3e9623518e6345bb6fa97 (diff)
[ugc] review fixes
Diffstat (limited to 'tools')
-rwxr-xr-xtools/unix/generate_planet.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh
index 1873741b60..3fa5ae09b2 100755
--- a/tools/unix/generate_planet.sh
+++ b/tools/unix/generate_planet.sh
@@ -318,10 +318,21 @@ if [ ! -f "$VIATOR_FILE" -a -n "${VIATOR_KEY-}" ]; then
fi
# Download UGC (user generated content) database.
-if [ -n "${UGC-}" ]; then
+if if [ ! -f "$UGC_FILE" -a -n "${UGC_DATABASE_URL-}" ]; then
putmode "Step UGC: Dowloading UGC database"
(
- curl "https://dummy.ru/" --output "$UGC_FILE" --silent || fail "Failed to download UGC database."
+ curl "$UGC_DATABASE_URL" --output "$UGC_FILE" --silent || true
+ if [ -f "$UGC_FILE" -a "$(wc -l < "$UGC_FILE" || echo 0)" -gt 100 ]; then
+ echo "UGC database have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG"
+ else
+ if [ -n "${OLD_INTDIR-}" -a -f "${OLD_INTDIR-}/$(basename "$UGC_FILE")" ]; then
+ cp "$OLD_INTDIR/$(basename "$UGC_FILE")" "$INTDIR"
+ warn "Failed to download UGC database! Using older UGC database."
+ else
+ warn "Failed to download UGC database!"
+ fi
+ [ -n "${MAIL-}" ] && tail "$LOG_PATH/ugc.log" | mailx -s "Failed to download UGC database at $(hostname), please hurry to fix" "$MAIL"
+ fi
) &
fi