Skip to content

Commit 10b72de

Browse files
committed
In the pg_upgrade test suite, remove and recreate "tmp_check".
This allows "vcregress upgradecheck" to pass twice in immediate succession, and it's more like how $(prove_check) works. Back-patch to 9.5, where pg_upgrade moved to src/bin. Discussion: https://postgr.es/m/20190520012436.GA1480421@rfd.leadboat.com
1 parent d5ec46b commit 10b72de

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bin/pg_upgrade/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export PGHOST
6969

7070
# don't rely on $PWD here, as old shells don't set it
7171
temp_root=`pwd`/tmp_check
72+
rm -rf "$temp_root"
73+
mkdir "$temp_root"
7274

7375
: ${oldbindir=$bindir}
7476

@@ -93,7 +95,6 @@ export PATH
9395
BASE_PGDATA="$temp_root/data"
9496
PGDATA="${BASE_PGDATA}.old"
9597
export PGDATA
96-
rm -rf "$BASE_PGDATA" "$PGDATA"
9798

9899
logdir=`pwd`/log
99100
rm -rf "$logdir"

src/tools/msvc/vcregress.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ sub upgradecheck
546546
$ENV{PGHOST} = 'localhost';
547547
$ENV{PGPORT} ||= 50432;
548548
my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check";
549-
(mkdir $tmp_root || die $!) unless -d $tmp_root;
549+
rmtree($tmp_root);
550+
mkdir $tmp_root || die $!;
550551
my $upg_tmp_install = "$tmp_root/install"; # unshared temp install
551552
print "Setting up temp install\n\n";
552553
Install($upg_tmp_install, "all", $config);
@@ -559,7 +560,8 @@ sub upgradecheck
559560
my $data = "$tmp_root/data";
560561
$ENV{PGDATA} = "$data.old";
561562
my $logdir = "$topdir/src/bin/pg_upgrade/log";
562-
(mkdir $logdir || die $!) unless -d $logdir;
563+
rmtree($logdir);
564+
mkdir $logdir || die $!;
563565
print "\nRunning initdb on old cluster\n\n";
564566
standard_initdb() or exit 1;
565567
print "\nStarting old cluster\n\n";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy