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
diff options
context:
space:
mode:
authorIlya Zverev <zverik@textual.ru>2015-11-15 00:06:13 +0300
committerIlya Zverev <zverik@textual.ru>2015-11-15 01:02:29 +0300
commit031c13a2ace448d5fa5141c031f9bf05f2dc15ee (patch)
treee3ac26a6fdf10e6842fd197c308d803628d71a9e
parent9bc8a7b12977a3c61ac432ae7286b9b24fe72537 (diff)
Fixes for new tests
-rw-r--r--generator/osm2meta.cpp8
-rwxr-xr-xtools/unix/diff_features.py2
-rwxr-xr-xtools/unix/diff_size.py4
-rwxr-xr-xtools/unix/generate_planet.sh23
4 files changed, 20 insertions, 17 deletions
diff --git a/generator/osm2meta.cpp b/generator/osm2meta.cpp
index 985c20a5c3..8a6c3096ce 100644
--- a/generator/osm2meta.cpp
+++ b/generator/osm2meta.cpp
@@ -27,7 +27,7 @@ string MetadataTagProcessor::ValidateAndFormat_wikipedia(string v) const
return v.substr(slashIndex + 1, baseIndex - slashIndex - 1) + ":" + title;
}
}
- LOG(LWARNING, ("Invalid Wikipedia tag value:", v));
+ LOG(LINFO, ("Invalid Wikipedia tag value:", v));
return string();
}
// Standard case: "lang:Article Name With Spaces".
@@ -35,13 +35,13 @@ string MetadataTagProcessor::ValidateAndFormat_wikipedia(string v) const
auto const colonIndex = v.find(':');
if (colonIndex == string::npos || colonIndex < 2 || colonIndex + 2 > v.size())
{
- LOG(LWARNING, ("Invalid Wikipedia tag value:", v));
+ LOG(LINFO, ("Invalid Wikipedia tag value:", v));
return string();
}
// Check if it's not a random/invalid link.
- if (v.find('/') != string::npos)
+ if (v.find("//") != string::npos)
{
- LOG(LWARNING, ("Invalid Wikipedia tag value:", v));
+ LOG(LINFO, ("Invalid Wikipedia tag value:", v));
return string();
}
// Normalize to OSM standards.
diff --git a/tools/unix/diff_features.py b/tools/unix/diff_features.py
index d9dcd9ff27..ca96a752b5 100755
--- a/tools/unix/diff_features.py
+++ b/tools/unix/diff_features.py
@@ -21,7 +21,7 @@ with open(sys.argv[1], 'r') as f:
for line in f:
parse_and_add(data2, line)
-threshold = (int(sys.argv[3]) if len(sys.argv) > 3 else 50) / 100.0 + 1
+threshold = (int(sys.argv[3]) if len(sys.argv) > 3 else 100) / 100.0 + 1
min_diff = 40
for k in data1:
diff --git a/tools/unix/diff_size.py b/tools/unix/diff_size.py
index 6235e36793..1bb506cc84 100755
--- a/tools/unix/diff_size.py
+++ b/tools/unix/diff_size.py
@@ -11,7 +11,7 @@ old_path = sys.argv[2]
threshold = (int(sys.argv[3]) if len(sys.argv) > 3 else 10) / 100.0 + 1
min_diff = 1024 * 1024
-for f in os.listdir(new_path):
+for f in sorted(os.listdir(old_path)):
new_file = os.path.join(new_path, f)
old_file = os.path.join(old_path, f)
if os.path.isfile(new_file) and os.path.isfile(old_file):
@@ -19,6 +19,6 @@ for f in os.listdir(new_path):
old_size = os.path.getsize(old_file)
if new_size + old_size > 0:
if new_size == 0 or old_size == 0 or max(new_size, old_size) / float(min(new_size, old_size)) > threshold and abs(new_size - old_size) > min_diff:
- print '{0}: {1} to {2} MB'.format(f, old_size / 1024 / 1024, new_size / 1024 / 1024)
+ print '{0}: {1} {2} to {3} MB'.format(f, old_size / 1024 / 1024, 'up' if new_size > old_size else 'down', new_size / 1024 / 1024)
else:
print 'Not found a mirror for {0}'.format(f)
diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh
index 381146da21..72a1264673 100755
--- a/tools/unix/generate_planet.sh
+++ b/tools/unix/generate_planet.sh
@@ -382,18 +382,23 @@ if [ "$MODE" == "routing" ]; then
MODE=resources
fi
+# Clean up temporary routing files
+[ -f "$OSRM_FLAG" ] && rm "$OSRM_FLAG"
+[ -n "$(ls "$TARGET" | grep '\.mwm\.osm2ft')" ] && mv "$TARGET"/*.mwm.osm2ft "$INTDIR"
+
if [ "$MODE" == "resources" ]; then
putmode "Step 7: Updating resource lists"
# Update countries list
[ ! -e "$TARGET/countries.txt" ] && cp "$DATA_PATH/countries.txt" "$TARGET/countries.txt"
- "$GENERATOR_TOOL" --data_path="$TARGET" --planet_version="$UPDATE_DATE" --user_resource_path="$DATA_PATH/" -generate_update 2>> "$PLANET_LOG"
- # We have no means of finding the resulting file, so let's assume it was magically placed in DATA_PATH
- [ -e "$TARGET/countries.txt.updated" ] && mv "$TARGET/countries.txt.updated" "$TARGET/countries.txt"
- # If we know the planet's version, update it in countries.txt
- if [ -n "${UPDATE_DATE-}" ]; then
- # In-place editing works differently on OS X and Linux, hence two steps
- sed -e "s/\"v\":[0-9]\\{6\\}/\"v\":$UPDATE_DATE/" "$TARGET/countries.txt" > "$INTDIR/countries.txt"
- mv "$INTDIR/countries.txt" "$TARGET"
+ if "$GENERATOR_TOOL" --data_path="$TARGET" --planet_version="$UPDATE_DATE" --user_resource_path="$DATA_PATH/" -generate_update 2>> "$PLANET_LOG"; then
+ # We have no means of finding the resulting file, so let's assume it was magically placed in DATA_PATH
+ [ -e "$TARGET/countries.txt.updated" ] && mv "$TARGET/countries.txt.updated" "$TARGET/countries.txt"
+ # If we know the planet's version, update it in countries.txt
+ if [ -n "${UPDATE_DATE-}" ]; then
+ # In-place editing works differently on OS X and Linux, hence two steps
+ sed -e "s/\"v\":[0-9]\\{6\\}/\"v\":$UPDATE_DATE/" "$TARGET/countries.txt" > "$INTDIR/countries.txt"
+ mv "$INTDIR/countries.txt" "$TARGET"
+ fi
fi
# A quick fix: chmodding to a+rw all generated files
for file in "$TARGET"/*.mwm*; do
@@ -440,8 +445,6 @@ if [ -n "$(ls "$TARGET" | grep '\.mwm')" ]; then
fi
# Cleaning up temporary directories
rm "$STATUS_FILE"
-[ -f "$OSRM_FLAG" ] && rm "$OSRM_FLAG"
-[ -n "$(ls "$TARGET" | grep '\.mwm\.osm2ft')" ] && mv "$TARGET"/*.mwm.osm2ft "$INTDIR"
[ -z "$KEEP_INTDIR" ] && rm -r "$INTDIR"
trap - SIGTERM ERR
log "STATUS" "Done"