When the update of the planet file was not complete (when
pyosmium-up-to-date returns 1), the resulting planet is nevertheless
usable, so we can keep it instead of creating a temporary one. This way
we use less disk space because there is one fewer copy of the planet
around.
PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
-PLANETTMP="${PLANETDIR}/planet-tmp.${SUFFIX}"
pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
retval=$?
while [ $retval -eq 1 ]; do
- mv "$PLANETNEW" "$PLANETTMP"
- pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETTMP"
+ mv "$PLANETCURR" "$PLANETPREV"
+ mv "$PLANETNEW" "$PLANETCURR"
+ pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
retval=$?
- rm "$PLANETTMP"
done
if [ $retval -ne 0 ]; then