2
0
Fork 0

osm-garmin: improve map versioning

main
Ducky 2023-10-01 02:44:53 +01:00
parent 534fc63d32
commit 47696a43af
1 changed files with 11 additions and 3 deletions

View File

@ -19,13 +19,21 @@ function build_gmap() {
region_shortname="$(get_region_shortname "$region")" region_shortname="$(get_region_shortname "$region")"
generated_map_dir="$out_dir/$region_shortname/" generated_map_dir="$out_dir/$region_shortname/"
version_path="$generated_map_dir/version.txt"
bounds_dir_md5="$(get_md5_dir "$bounds_dir")" bounds_dir_md5="$(get_md5_dir "$bounds_dir")"
map_md5="$(get_md5 "$maps_dir/$region_shortname.osm.pbf")" map_md5="$(get_md5 "$maps_dir/$region_shortname.osm.pbf")"
style_md5="$(get_md5 "$styles_dir/$style.TYP")" style_md5="$(get_md5 "$styles_dir/$style.TYP")"
version="$(echo "$bounds_dir_md5|$map_md5|$style_md5" | md5sum | cut -d' ' -f1)" version_id=""
version_path="$generated_map_dir/version.txt" version_md5="$(echo "$bounds_dir_md5|$map_md5|$style_md5" | md5sum | cut -d' ' -f1)"
if [[ -f "$version_path" ]]; then
version_id="$(cat "$version_path" | cut -d'|' -f1)"
version_id="$((version_id+1))"
fi
version="$version_id|$version_md5"
build="true" build="true"
build_failed="false" build_failed="false"
@ -43,7 +51,7 @@ function build_gmap() {
family_name="" family_name=""
product_id="$region_id" product_id="$region_id"
product_version="$(date --utc +%y%j%H%M)" product_version="$version_id"
[[ -n $OSMGARMIN_MAP_FAMILY_NAME ]] && family_name="$OSMGARMIN_MAP_FAMILY_NAME" [[ -n $OSMGARMIN_MAP_FAMILY_NAME ]] && family_name="$OSMGARMIN_MAP_FAMILY_NAME"