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>2016-11-11 19:20:27 +0300
committerIlya Zverev <zverik@textual.ru>2016-11-14 17:42:45 +0300
commit9fd4c120648e6e902b924d5da0d8de42cbe27084 (patch)
tree3f2cf16218137cca8033a0022b9e56bb5bec6452 /tools
parent77206c4859e4dd0d06b954f2ae9e24dce0fbc795 (diff)
[build] Small fixes to build process and styles
Diffstat (limited to 'tools')
m---------tools/kothic0
-rwxr-xr-xtools/python/booking_hotels.py8
-rw-r--r--tools/python/mwm/mwm.py2
-rwxr-xr-xtools/unix/build_omim.sh8
-rwxr-xr-xtools/unix/generate_planet.sh23
5 files changed, 33 insertions, 8 deletions
diff --git a/tools/kothic b/tools/kothic
-Subproject c32d9c5e22d6f42c582c2234e9881cda5f6db4f
+Subproject 1ffa4306fe949c6345414823946ee7b1bbf8a07
diff --git a/tools/python/booking_hotels.py b/tools/python/booking_hotels.py
index d64c1f9e8c..8b315d7e3e 100755
--- a/tools/python/booking_hotels.py
+++ b/tools/python/booking_hotels.py
@@ -89,7 +89,8 @@ def download(user, password, path):
# Check for error.
if hotels is None:
- exit(1)
+ logging.critical('No hotels downloaded for country {0}'.format(country['name']))
+ break
for h in hotels:
allhotels[h['hotel_id']] = h
@@ -98,6 +99,9 @@ def download(user, password, path):
if len(hotels) < maxrows:
break
+ if not hotels:
+ continue
+
# Now the same for hotel translations
offset = 0
while True:
@@ -116,6 +120,8 @@ def download(user, password, path):
if len(hotels) < maxrows:
break
+ if not hotels:
+ raise Exception('Failed to load any hotels')
logging.info('Num of hotels: {0}, translations: {1}'.format(len(allhotels), offset))
filename = os.path.join(path,
'{0} - {1}.pkl'.format(country['area'].encode('utf8'), country['name'].encode('utf8')))
diff --git a/tools/python/mwm/mwm.py b/tools/python/mwm/mwm.py
index 65929831bd..bb8f3d8100 100644
--- a/tools/python/mwm/mwm.py
+++ b/tools/python/mwm/mwm.py
@@ -258,7 +258,7 @@ class MWM:
if type_id < len(self.type_mapping):
types.append(self.type_mapping[type_id])
else:
- types.append(str(type_id))
+ types.append(str(type_id + 1)) # So the numbers match with mapcss-mapping.csv
header['types'] = types
if has_name:
header['name'] = self.read_multilang()
diff --git a/tools/unix/build_omim.sh b/tools/unix/build_omim.sh
index 0ee6527b24..509ca9f7c4 100755
--- a/tools/unix/build_omim.sh
+++ b/tools/unix/build_omim.sh
@@ -96,7 +96,13 @@ build_conf()
else
"$QMAKE" "$OMIM_PATH/omim.pro" -spec $SPEC CONFIG+=$CONF ${CONFIG+"CONFIG*=$CONFIG"}
fi
- make -j $PROCESSES
+ TMP_FILE="build_error.log"
+ if ! make -j $PROCESSES 2> "$TMP_FILE"; then
+ echo '--------------------'
+ cat "$TMP_FILE"
+ exit 1
+ fi
+ rm "$TMP_FILE"
)
}
diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh
index d3aa4e05f8..743e1b1284 100755
--- a/tools/unix/generate_planet.sh
+++ b/tools/unix/generate_planet.sh
@@ -138,6 +138,9 @@ OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}"
DATA_PATH="${DATA_PATH:-$OMIM_PATH/data}"
[ ! -r "${DATA_PATH}/types.txt" ] && fail "Cannot find classificators in $DATA_PATH, please set correct OMIM_PATH"
[ -n "$OPT_ROUTING" -a ! -f "$HOME/.stxxl" ] && fail "For routing, you need ~/.stxxl file. Run this: echo 'disk=$HOME/stxxl_disk1,400G,syscall' > $HOME/.stxxl"
+if [ -n "$OPT_ROUTING" -a -n "${OSRM_URL-}" ]; then
+ curl -s "http://$OSRM_URL/way_id" | grep -q position || fail "Cannot access $OSRM_URL"
+fi
TARGET="${TARGET:-$DATA_PATH}"
mkdir -p "$TARGET"
INTDIR="${INTDIR:-$TARGET/intermediate_data}"
@@ -254,8 +257,13 @@ if [ "$MODE" == "coast" ]; then
if [ ! -f "$BOOKING_FILE" -a -n "${BOOKING_USER-}" -a -n "${BOOKING_PASS-}" ]; then
log "STATUS" "Step S1: Starting background hotels downloading"
(
- $PYTHON $BOOKING_SCRIPT --user $BOOKING_USER --password $BOOKING_PASS --path "$INTDIR" --download --translate --output "$BOOKING_FILE" 2>"$LOG_PATH"/booking.log &
- echo "Hotels have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG"
+ $PYTHON $BOOKING_SCRIPT --user $BOOKING_USER --password $BOOKING_PASS --path "$INTDIR" --download --translate --output "$BOOKING_FILE" 2>"$LOG_PATH"/booking.log || true
+ if [ -f "$BOOKING_FILE" -a "$(wc -l < "$BOOKING_FILE" || echo 0)" -gt 100 ]; then
+ echo "Hotels have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG"
+ else
+ log "Failed to download hotels!"
+ [ -n "${MAIL-}" ] && tail "$LOG_PATH/booking.log" | mailx -s "Failed to download hotels at $(hostname), please hurry to fix" "$MAIL"
+ fi
) &
fi
@@ -263,8 +271,13 @@ if [ "$MODE" == "coast" ]; then
if [ ! -f "$OPENTABLE_FILE" -a -n "${OPENTABLE_USER-}" -a -n "${OPENTABLE_PASS-}" ]; then
log "STATUS" "Step S2: Starting background restaurants downloading"
(
- $PYTHON $OPENTABLE_SCRIPT --client $OPENTABLE_USER --secret $OPENTABLE_PASS --opentable_data "$INTDIR"/opentable.json --download --tsv "$OPENTABLE_FILE" 2>"$LOG_PATH"/opentable.log &
- echo "Restaurants have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG"
+ $PYTHON $OPENTABLE_SCRIPT --client $OPENTABLE_USER --secret $OPENTABLE_PASS --opentable_data "$INTDIR"/opentable.json --download --tsv "$OPENTABLE_FILE" 2>"$LOG_PATH"/opentable.log || true
+ if [ -f "$OPENTABLE_FILE" -a "$(wc -l < "$OPENTABLE_FILE" || echo 0)" -gt 100 ]; then
+ echo "Restaurants have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG"
+ else
+ log "Failed to download restaurants!"
+ [ -n "${MAIL-}" ] && tail "$LOG_PATH/opentable.log" | mailx -s "Failed to download restaurants at $(hostname), please hurry to fix" "$MAIL"
+ fi
) &
fi
@@ -312,7 +325,7 @@ if [ "$MODE" == "coast" ]; then
then
log "STATUS" "Coastline merge failed"
if [ -n "$OPT_UPDATE" ]; then
- [ -n "${MAIL-}" ] && tail -n 50 "$LOG_PATH/WorldCoasts.log" | mailx -s "Generate_planet: coastline merge failed, next try in $MERGE_INTERVAL minutes" "$MAIL"
+ [ -n "${MAIL-}" ] && tail -n 50 "$LOG_PATH/WorldCoasts.log" | mailx -s "Coastline merge at $(hostname) failed, next try in $MERGE_INTERVAL minutes" "$MAIL"
echo "Will try fresh coasts again in $MERGE_INTERVAL minutes, or press a key..."
read -rs -n 1 -t $(($MERGE_INTERVAL * 60)) || true
TRY_AGAIN=1