Windows sometimes gets upset if we rename a large directory and then try
to use the old name quickly, as seen in occasional buildfarm failures.
So we avoid that by building the old version in the intended
destination in the first place instead of renaming it, similar to the
change made for the same reason in commit
b7f8465c.
PATH=$bindir:$PATH
export PATH
-PGDATA=$temp_root/data
+BASE_PGDATA=$temp_root/data
+PGDATA="$BASE_PGDATA.old"
export PGDATA
-rm -rf "$PGDATA" "$PGDATA".old
+rm -rf "$BASE_PGDATA" "$PGDATA"
unset PGDATABASE
unset PGUSER
exit 1
fi
-mv "${PGDATA}" "${PGDATA}.old"
+PGDATA=$BASE_PGDATA
initdb