From 9fd4c120648e6e902b924d5da0d8de42cbe27084 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Fri, 11 Nov 2016 19:20:27 +0300 Subject: [PATCH 1/2] [build] Small fixes to build process and styles --- data/mapcss-mapping.csv | 2 +- tools/kothic | 2 +- tools/python/booking_hotels.py | 8 +++++++- tools/python/mwm/mwm.py | 2 +- tools/unix/build_omim.sh | 8 +++++++- tools/unix/generate_planet.sh | 23 ++++++++++++++++++----- 6 files changed, 35 insertions(+), 10 deletions(-) diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 5ee8c58927..ba14da09a9 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -1098,7 +1098,7 @@ shop|wine;1097; tourism|chalet;1098; tourism|information|board;[tourism=information][information=board];;name;int_name;1099; tourism|information|map;[tourism=information][information=map];;name;int_name;1100; -tourism|information|office;[tourism=information][information=office];;name;int_name;1101; +tourism|information|office;[tourism=information][information=office];x;name;int_name;1101;tourism|information|office traffic_calming|bump;1102; traffic_calming|hump;1103; shop|car_parts;1104; diff --git a/tools/kothic b/tools/kothic index c32d9c5e22..1ffa4306fe 160000 --- a/tools/kothic +++ b/tools/kothic @@ -1 +1 @@ -Subproject commit c32d9c5e22d6f42c582c2234e9881cda5f6db4f5 +Subproject commit 1ffa4306fe949c6345414823946ee7b1bbf8a07e 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 From 0c8eec1616b20c23ea8d087fb94a69297590279e Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Fri, 11 Nov 2016 20:12:38 +0300 Subject: [PATCH 2/2] [build] Rebuilt styles --- data/drules_proto.bin | Bin 247661 -> 247456 bytes data/drules_proto.txt | 68 ----------------------------------- data/drules_proto_clear.bin | Bin 211042 -> 210837 bytes data/drules_proto_clear.txt | 68 ----------------------------------- data/drules_proto_dark.bin | Bin 208419 -> 208214 bytes data/drules_proto_dark.txt | 68 ----------------------------------- data/drules_proto_legacy.bin | Bin 210158 -> 209998 bytes data/drules_proto_legacy.txt | 51 -------------------------- 8 files changed, 255 deletions(-) diff --git a/data/drules_proto.bin b/data/drules_proto.bin index 118fde0edf17aaa3173d50ff7f7bc101ccf9cf55..c5b09ee92a07ea5e6c2dcc01bee68832235333ea 100644 GIT binary patch delta 21 dcmaFc$G@PLzoCV(g=q`({gvC-tYSVW0|03P34Q@={2_OIf diff --git a/data/drules_proto_clear.txt b/data/drules_proto_clear.txt index 19f27a2be2..f0c7ac11a2 100644 --- a/data/drules_proto_clear.txt +++ b/data/drules_proto_clear.txt @@ -67004,74 +67004,6 @@ cont { } } } -cont { - name: "tourism-information-office" - element { - scale: 16 - symbol { - name: "information-s" - apply_for_type: 1 - priority: 16607 - min_distance: 10 - } - caption { - primary { - height: 10 - color: 4473924 - offset_y: 6 - } - priority: 15607 - } - } - element { - scale: 17 - symbol { - name: "information-s" - apply_for_type: 1 - priority: 16607 - } - caption { - primary { - height: 10 - color: 4473924 - offset_y: 6 - } - priority: 15607 - } - } - element { - scale: 18 - symbol { - name: "information-s" - apply_for_type: 1 - priority: 16637 - } - caption { - primary { - height: 11 - color: 4473924 - offset_y: 12 - } - priority: 15637 - } - } - element { - scale: 19 - symbol { - name: "information-s" - apply_for_type: 1 - priority: 16637 - } - caption { - primary { - height: 11 - color: 4473924 - offset_y: 12 - } - priority: 15637 - } - } -} cont { name: "tourism-motel" element { diff --git a/data/drules_proto_dark.bin b/data/drules_proto_dark.bin index 50b55ab64041142787d8c7a5670eed73e34df895..48b3baa1e7319128fb064611d123a8354ac9c3f6 100644 GIT binary patch delta 21 ccmZ2{hv(WYo`x327N#xCuA