]> granicus.if.org Git - postgresql/commitdiff
Avoid moving data directory in upgrade testing.
authorAndrew Dunstan <andrew@dunslane.net>
Sat, 30 Mar 2013 16:54:36 +0000 (12:54 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sat, 30 Mar 2013 16:54:36 +0000 (12:54 -0400)
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.

contrib/pg_upgrade/test.sh

index 32a11b093b1f4bf1d6c62bfc1192f3055146aa8c..313701c4f23ecc8fc3a792c8e7588f2f41f43dc6 100644 (file)
@@ -62,9 +62,10 @@ newsrc=`cd ../.. && pwd`
 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
@@ -120,7 +121,7 @@ if [ -n "$pg_dumpall1_status" ]; then
        exit 1
 fi
 
-mv "${PGDATA}" "${PGDATA}.old"
+PGDATA=$BASE_PGDATA
 
 initdb