0001-Avoid-non-POSIX-cp-flags.patch

text/x-patch

Filename: 0001-Avoid-non-POSIX-cp-flags.patch
Type: text/x-patch
Part: 0
Message: Re: initdb caching during tests

Patch

Format: format-patch
Series: patch 0001
Subject: Avoid non-POSIX cp flags.
File+
src/test/perl/PostgreSQL/Test/Cluster.pm 1 1
src/test/regress/pg_regress.c 1 1
From fd6c558e6bd43eef40d633ace763d8a2088c2509 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Fri, 25 Aug 2023 17:30:48 +1200
Subject: [PATCH] Avoid non-POSIX cp flags.

Commit 252dcb32 introduced cp -a, but apparently Solaris doesn't like
it.  Use cp -RPp instead.

diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 426f94ff09..227c34ab4d 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -549,7 +549,7 @@ sub init
 		}
 		else
 		{
-			@copycmd = qw(cp -a);
+			@copycmd = qw(cp -RPp);
 			$expected_exitcode = 0;
 		}
 
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 06674141a3..ec67588cf5 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2355,7 +2355,7 @@ regression_main(int argc, char *argv[],
 		else
 		{
 #ifndef WIN32
-			const char *copycmd = "cp -a \"%s\" \"%s/data\"";
+			const char *copycmd = "cp -RPp \"%s\" \"%s/data\"";
 			int			expected_exitcode = 0;
 #else
 			const char *copycmd = "robocopy /E /NJS /NJH /NFL /NDL /NP \"%s\" \"%s/data\"";
-- 
2.39.2