From: Peter Eisentraut <peter_e@gmx.net>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Change TAP test framework to not rely on having a chmod executab
Date: Tue, 25 Aug 2015 10:02:23 -0400
Message-ID: <55DC756F.6030505@gmx.net> (raw)
In-Reply-To: <E1Z5xeo-00035n-Te@gemulon.postgresql.org>
References: <E1Z5xeo-00035n-Te@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 6/19/15 10:52 AM, Robert Haas wrote:
> Change TAP test framework to not rely on having a chmod executable.
>
> This might not work at all on Windows, and is not ever efficient.
>
> Michael Paquier
I came across this on an unrelated mission and noticed it was
unnecessarily complicated. How about this patch instead?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:0001-Simplify-Perl-chmod-calls.patch (text/x-diff, 1.4K) download
From 3062d1ad69774f7dd68eb8f307997ae32d3535f2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 25 Aug 2015 09:58:49 -0400
Subject: [PATCH] Simplify Perl chmod calls
The Perl chmod function already takes multiple file arguments, so we
don't need a separate looping function.
---
src/test/ssl/ServerSetup.pm | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/src/test/ssl/ServerSetup.pm b/src/test/ssl/ServerSetup.pmindex 8c1b517..a8228b0 100644--- a/src/test/ssl/ServerSetup.pm+++ b/src/test/ssl/ServerSetup.pm@@ -43,20 +43,6 @@ sub copy_files
}
}
-# Perform chmod on a set of files, taking into account wildcards-sub chmod_files-{- my $mode = shift;- my $file_expr = shift;-- my @all_files = glob $file_expr;- foreach my $file_entry (@all_files)- {- chmod $mode, $file_entry- or die "Could not run chmod with mode $mode on $file_entry";- }-}-
sub configure_test_server_for_ssl
{
my $tempdir = $_[0];
@@ -82,7 +68,7 @@ sub configure_test_server_for_ssl
# Copy all server certificates and keys, and client root cert, to the data dir
copy_files("ssl/server-*.crt", "$tempdir/pgdata");
copy_files("ssl/server-*.key", "$tempdir/pgdata");
- chmod_files(0600, "$tempdir/pgdata/server-*.key");+ chmod(0600, glob "$tempdir/pgdata/server-*.key") or die $!;
copy_files("ssl/root+client_ca.crt", "$tempdir/pgdata");
copy_files("ssl/root+client.crl", "$tempdir/pgdata");
--
2.5.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter_e@gmx.net, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Change TAP test framework to not rely on having a chmod executab
In-Reply-To: <55DC756F.6030505@gmx.net>
References: <E1Z5xeo-00035n-Te@gemulon.postgresql.org> <55DC756F.6030505@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox