Port regress-python3-mangle.mk to Solaris "sed", redux.
authorTom Lane <[email protected]>
Thu, 1 Sep 2022 01:33:45 +0000 (21:33 -0400)
committerTom Lane <[email protected]>
Thu, 1 Sep 2022 01:33:45 +0000 (21:33 -0400)
Per experimentation and buildfarm failures, Solaris' "sed"
has got some kind of problem with regexes that use both '*'
and '[[:alpha:]]'.  We can work around that by replacing
'[[:alpha:]]' with '[a-zA-Z]', which is plenty good enough
for our purposes, especially since this is only needed in
long-stable branches.

I chose to flat-out remove the second pattern of this sort,
's/except \([a-zA-Z][a-zA-Z.]*\), *\([a-zA-Z][a-zA-Z]*\):/except \1 as \2:/g'
because we haven't needed it since 8.4.

Follow-on to c3556f6fa, which probably missed catching this
because the problematic pattern was already gone when that
patch was written.

Patch v10-v12 only, as the problem manifests only there.
We have a line of dead code in v13-v14, which isn't worth
changing, and the whole mess is gone as of v15.

Discussion: https://postgr.es/m/165561.1661984701@sss.pgh.pa.us

src/pl/plpython/regress-python3-mangle.mk

index d5f805d1cb4a0a763e97c99f702adec024292bc2..f78238743cd3d8060101606a45fc4a1168fee15b 100644 (file)
@@ -14,8 +14,7 @@ REGRESS := $(foreach test,$(REGRESS),$(if $(filter $(test),$(REGRESS_PLPYTHON3_M
 pgregress-python3-mangle:
    $(MKDIR_P) sql/python3 expected/python3 results/python3
    for file in $(patsubst %,$(srcdir)/sql/%.sql,$(REGRESS_PLPYTHON3_MANGLE)) $(patsubst %,$(srcdir)/expected/%*.out,$(REGRESS_PLPYTHON3_MANGLE)); do \
-     sed -e 's/except \([[:alpha:]][[:alpha:].]*\), *\([[:alpha:]][[:alpha:]]*\):/except \1 as \2:/g' \
-         -e "s/<type 'exceptions\.\([[:alpha:]]*\)'>/<class '\1'>/g" \
+     sed -e 's/except \([a-zA-Z][a-zA-Z.]*\), *\([a-zA-Z][a-zA-Z]*\):/except \1 as \2:/g' \
          -e "s/<type 'long'>/<class 'int'>/g" \
          -e "s/\([0-9][0-9]*\)L/\1/g" \
          -e 's/\([ [{]\)u"/\1"/g' \