]> git.openstreetmap.org Git - chef.git/commitdiff
planet: do not keep previous planet around.
authorGrant Slater <github@firefishy.com>
Fri, 1 Nov 2024 18:51:26 +0000 (18:51 +0000)
committerGrant Slater <github@firefishy.com>
Fri, 1 Nov 2024 18:51:26 +0000 (18:51 +0000)
cookbooks/planet/templates/default/planet-update.erb

index 73a778bbaaa812c9bd33455683f0e05b0b41d3d7..fbfc6592fce5979226f4ebbde4140d4453916b6b 100644 (file)
@@ -11,11 +11,14 @@ PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
 PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
 PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
 
 PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
 PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
 
+rm -f "$PLANETPREV"
+
 pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
 retval=$?
 
 while [ $retval -eq 1 ]; do
     mv "$PLANETCURR" "$PLANETPREV"
 pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
 retval=$?
 
 while [ $retval -eq 1 ]; do
     mv "$PLANETCURR" "$PLANETPREV"
+    rm -f "$PLANETPREV"
     mv "$PLANETNEW" "$PLANETCURR"
     pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
     retval=$?
     mv "$PLANETNEW" "$PLANETCURR"
     pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
     retval=$?
@@ -28,4 +31,5 @@ fi
 # cleanup
 
 mv "$PLANETCURR" "$PLANETPREV"
 # cleanup
 
 mv "$PLANETCURR" "$PLANETPREV"
+rm -f "$PLANETPREV"
 mv "$PLANETNEW" "$PLANETCURR"
 mv "$PLANETNEW" "$PLANETCURR"