From: Tom Hughes Date: Fri, 14 Sep 2018 18:08:49 +0000 (+0100) Subject: Handle planet updates that need multiple passes correctly X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/c49b0d9c728b6380d6de69e468296af0ccc5e018?ds=sidebyside Handle planet updates that need multiple passes correctly --- diff --git a/cookbooks/cplanet/templates/default/update-planet.erb b/cookbooks/cplanet/templates/default/update-planet.erb index e992c3578..6c77eafa6 100644 --- a/cookbooks/cplanet/templates/default/update-planet.erb +++ b/cookbooks/cplanet/templates/default/update-planet.erb @@ -8,11 +8,16 @@ PLANETDIR="<%= @basedir %>/planet" PLANETPREV="${PLANETDIR}/planet-previous.pbf" PLANETCURR="${PLANETDIR}/planet.pbf" PLANETNEW="${PLANETDIR}/planet-new.pbf" +PLANETTMP="${PLANETDIR}/planet-tmp.pbf" + +pyosmium-up-to-date -v -o $PLANETNEW $PLANETCURR +retval=$? -retval=1 while [ $retval -eq 1 ]; do - pyosmium-up-to-date -v -o $PLANETNEW $PLANETCURR + mv "$PLANETNEW" "$PLANETTMP" + pyosmium-up-to-date -v -o $PLANETNEW $PLANETTMP retval=$? + rm "$PLANETTMP" done if [ $retval -ne 0 ]; then