Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgWoP-0002v9-Jm for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jul 2018 14:55:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgWoM-0001sz-NJ for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jul 2018 14:55:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgWoM-0001so-GO for pgsql-hackers@lists.postgresql.org; Fri, 20 Jul 2018 14:55:14 +0000 Received: from mx.wagner.pp.ru ([2a01:4f8:c17:2e5b::2]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgWoJ-0007ok-OX for pgsql-hackers@postgresql.org; Fri, 20 Jul 2018 14:55:14 +0000 Received: from fafnir.local.vm (unknown [93.174.131.141]) by mx.wagner.pp.ru (Postfix) with ESMTPSA id 5869CE0124; Fri, 20 Jul 2018 17:55:09 +0300 (MSK) Date: Fri, 20 Jul 2018 17:55:08 +0300 From: Victor Wagner To: Tom Lane Cc: pgsql-hackers Subject: Re: Non-portable shell code in pg_upgrade tap tests Message-ID: <20180720175508.07776219@fafnir.local.vm> In-Reply-To: <17833.1532096747@sss.pgh.pa.us> References: <20180720153820.69e9ae6c@fafnir.local.vm> <17833.1532096747@sss.pgh.pa.us> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/eykEZHZkaDaEjh64y39tiwn" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --MP_/eykEZHZkaDaEjh64y39tiwn Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, 20 Jul 2018 10:25:47 -0400 Tom Lane wrote: > Victor Wagner writes: > > I've discovered that in the branch REL_11_STABLE there is shell > > script src/bin/pg_upgrade/test.sh which doesn't work under Solaris > > 10. (it uses $(command) syntax with is not compatible with original > > Solaris /bin/sh) > > Please send a patch. Most of us do not have access to old shells Here it goes. Previous letter was written before fixed tests were completed, because this old machine is slow. > we could test this on. (The oldest machine I have, and it's old > enough to vote, does run that script ... I doubt very many other > developers have anything older.) > > regards, tom lane --MP_/eykEZHZkaDaEjh64y39tiwn Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=original_systemV_sh_compatibility.patch commit efb0bbcefeccd826ba951ac31057689e752b79d0 Author: Victor Wagner Date: Fri Jul 20 16:06:50 2018 +0300 Fixed incompatibility of src/bin/pg_upgrade/test.sh with solaris /bin/sh diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh index 45ccd8fa66..775dd5729d 100644 --- a/src/bin/pg_upgrade/test.sh +++ b/src/bin/pg_upgrade/test.sh @@ -234,7 +234,7 @@ pg_upgrade $PG_UPGRADE_OPTS -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B # Windows hosts don't support Unix-y permissions. case $testhost in MINGW*) ;; - *) if [ $(find ${PGDATA} -type f ! -perm 640 | wc -l) -ne 0 ]; then + *) if [ `find ${PGDATA} -type f ! -perm 640 | wc -l` -ne 0 ]; then echo "files in PGDATA with permission != 640"; exit 1; fi ;; @@ -242,7 +242,7 @@ esac case $testhost in MINGW*) ;; - *) if [ $(find ${PGDATA} -type d ! -perm 750 | wc -l) -ne 0 ]; then + *) if [ `find ${PGDATA} -type d ! -perm 750 | wc -l` -ne 0 ]; then echo "directories in PGDATA with permission != 750"; exit 1; fi ;; --MP_/eykEZHZkaDaEjh64y39tiwn--