Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUEoB-0006Hk-El for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Aug 2015 14:02:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZUEoA-0006YP-1g for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Aug 2015 14:02:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZUEo9-0006YG-7k for pgsql-hackers@postgresql.org; Tue, 25 Aug 2015 14:02:37 +0000 Received: from mout.gmx.net ([212.227.15.18]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1ZUEo6-0005Es-Hn for pgsql-hackers@postgresql.org; Tue, 25 Aug 2015 14:02:36 +0000 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MGSDw-1ZYaNc07Gq-00DJ3j for ; Tue, 25 Aug 2015 16:02:32 +0200 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 03C5D20B03 for ; Tue, 25 Aug 2015 10:02:23 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 25 Aug 2015 10:02:24 -0400 X-Sasl-enc: p7War4+4/LUpcndjVSVyExH9DNCkPaTtRaD3aN7iwToT 1440511343 Received: from [192.168.1.146] (unknown [204.145.120.11]) by mail.messagingengine.com (Postfix) with ESMTPA id C40F3C00018; Tue, 25 Aug 2015 10:02:23 -0400 (EDT) Message-ID: <55DC756F.6030505@gmx.net> Date: Tue, 25 Aug 2015 10:02:23 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Michael Paquier CC: pgsql-hackers Subject: Re: [COMMITTERS] pgsql: Change TAP test framework to not rely on having a chmod executab References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------080500030406040601050400" X-Provags-ID: V03:K0:SWoPsUHVZtPBZ5kyU5tqA0YsuMg5orm1JyH8bAuJVEJunKt90QH URAHyPKZdtovZTM3hJzBl38vv0xAe7T1fiTDY91nmkLUiNcD4tVubLoPrkNVyJvzRBbZKpx 43JHlKuJlpkfO0hpauN4SVoDgRJXdLEo09+eS2hfHEpJN0c6lil/DTxc/OlFON2ws3bfYjp 4wz1jl0mECMtfv6sH/2nQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:d7SYoKlyfBw=:Hrv+N7YF+bpr6O0vbp03ul PPleZ2e+pU6YSkiUpsuv/2Ew5GoNlHOEFHxF0L1mIPb4Xq59PuX1f+6O4o7ylI9yqlJVf9PN3 Dl1YkhVeatHimJCdKLDWtM5U9Tv2bzGB021sLAFg05YdTNrBmBHXl+Uz/20RSesGgpI7yqbeg UZntGaow//45rF4tWKtL8JtNsbHUVuOz99RMTSHr1K9kGZw1DqUzcaltHJiEMNxHnT5121NNT LxxNzsRRjKRV/UAZ3IIoOrfYGqitKPEFI9k4Gmzeo6sRopTpkbehF5F7GbMurkNHOwg3rSm1/ mdYQUNbJsUTSDHBvEfXo642I8gwZhhtl1Xzczvebi4MgsdESYPHKVWCc0Y39AChbRzZxpSiPd x8Vgb6Uj45XZQCPDnxpRcIqv/HByjBnWYOZVTXci9GVJfgohofF4CWIzeChwghwn6M1UXT2Vv nRV3xbaYGGCE8Lq9b88mvxrpCKaHJWmdlUdzY1oNvQpNXD5+BMt4o+MCM5Zc6aksOSFz6xpZT HyJyg7JgAyylWYAxEb0Qydbqfihh74Lx96wzmWw9MriRSmugAbjdCVrKfVe+CWsi/36O5OnJO OIA/2xaAyHOsWr38qY9XGpKtmoA0a+0xmAAZHwl6XqKXnvVNuwsEGWkB5IlWEcSlxONKTq+ZX C/OxdFmKoZTDVLFjUZt7Urx9aw6EiXreFgwfL0fAEGi2BWeUN4W+TrZgrJdsbQ3Wffjuvp6qO CWmb0Jg/j1LfaIclUqWz9ULLiiQ68/vX9LrZYg== X-Pg-Spam-Score: -3.9 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------080500030406040601050400 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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? --------------080500030406040601050400 Content-Type: text/x-diff; name="0001-Simplify-Perl-chmod-calls.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Simplify-Perl-chmod-calls.patch" From 3062d1ad69774f7dd68eb8f307997ae32d3535f2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut 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.pm index 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 --------------080500030406040601050400 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------080500030406040601050400--