Fix vcregress plpython3 warning
Hi,
When running the plcheck in Windows we get the following warning, it is
visible in the cfbots [1]http://commitfest.cputube.org/:
Use of uninitialized value $1 in concatenation (.) or string at
src/tools/msvc/vcregress.pl line 350.
This points to mangle_plpython3 subroutine. The attached patch addresses
the problem.
[1]: http://commitfest.cputube.org/
Regards,
Juan José Santamaría Flecha
Attachments:
0001-Fix-vcregress-plpython3-warning.patchapplication/octet-stream; name=0001-Fix-vcregress-plpython3-warning.patchDownload
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 29086ca..935ac5c 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -347,7 +347,7 @@ sub mangle_plpython3
s/([ [{])u'/$1'/g;
s/def next/def __next__/g;
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
- s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
+ s/EXTENSION ([^ ]*_*)plpython2?u/EXTENSION $1plpython3u/g;
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
}
for ($contents);
On 1/7/22 07:20, Juan José Santamaría Flecha wrote:
Hi,
When running the plcheck in Windows we get the following warning, it
is visible in the cfbots [1]:Use of uninitialized value $1 in concatenation (.) or string at
src/tools/msvc/vcregress.pl <http://vcregress.pl> line 350.This points to mangle_plpython3 subroutine. The attached patch
addresses the problem.
Yeah, this code is not a model of clarity though. I had to think through
it and I write quite a bit of perl. I would probably write it something
like this:
s/EXTENSION (.*?)plpython2?u/EXTENSION $1plpython3u/g ;
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
On Fri, Jan 7, 2022 at 2:30 PM Andrew Dunstan <andrew@dunslane.net> wrote:
Yeah, this code is not a model of clarity though. I had to think through
it and I write quite a bit of perl. I would probably write it something
like this:s/EXTENSION (.*?)plpython2?u/EXTENSION $1plpython3u/g ;
Yeah, I had to do some testing to figure it out. Based on what
regress-python3-mangle.mk does, I think it tries to ignore cases such as:
DROP EXTENSION IF EXISTS plpython2u CASCADE;
Which that expression would match. Maybe use a couple of lines as in the
make file?
s/EXTENSION plpython2?u/EXTENSION plpython3u/g
s/EXTENSION ([^ ]*)_plpython2?u/EXTENSION \$1_plpython3u/g
Regards,
Juan José Santamaría Flecha
On Fri, Jan 7, 2022 at 2:56 PM Juan José Santamaría Flecha <
juanjo.santamaria@gmail.com> wrote:
copy-paste
Show quoted text
s/EXTENSION plpython2?u/EXTENSION plpython3u/g
s/EXTENSION ([^ ]*)_plpython2?u/EXTENSION $1_plpython3u/g
On 1/7/22 08:56, Juan José Santamaría Flecha wrote:
On Fri, Jan 7, 2022 at 2:30 PM Andrew Dunstan <andrew@dunslane.net> wrote:
Yeah, this code is not a model of clarity though. I had to think
through
it and I write quite a bit of perl. I would probably write it
something
like this:s/EXTENSION (.*?)plpython2?u/EXTENSION $1plpython3u/g ;
Yeah, I had to do some testing to figure it out. Based on
what regress-python3-mangle.mk <http://regress-python3-mangle.mk>
does, I think it tries to ignore cases such as:DROP EXTENSION IF EXISTS plpython2u CASCADE;
Which that expression would match. Maybe use a couple of lines as in
the make file?s/EXTENSION plpython2?u/EXTENSION plpython3u/g
s/EXTENSION ([^ ]*)_plpython2?u/EXTENSION \$1_plpython3u/g
In that case, just this should work:
s/EXTENSION (\S*?)plpython2?u/EXTENSION $1plpython3u/g ;
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
On Fri, Jan 7, 2022 at 3:24 PM Andrew Dunstan <andrew@dunslane.net> wrote:
In that case, just this should work:
s/EXTENSION (\S*?)plpython2?u/EXTENSION $1plpython3u/g ;
LGTM.
Regards,
Juan José Santamaría Flecha
On Fri, Jan 7, 2022 at 3:24 PM Andrew Dunstan <andrew@dunslane.net> wrote:
In that case, just this should work:
s/EXTENSION (\S*?)plpython2?u/EXTENSION $1plpython3u/g ;
Please find attached a patch for so. I have also open an item in the
commitfest:
https://commitfest.postgresql.org/37/3507/
Regards,
Juan José Santamaría Flecha
On Mon, Jan 10, 2022 at 12:51 PM Juan José Santamaría Flecha <
juanjo.santamaria@gmail.com> wrote:
Please find attached a patch for so.
The patch.
Regards,
Show quoted text
Juan José Santamaría Flecha
Attachments:
v2-0001-Fix-vcregress-plpython3-warnings.patchapplication/octet-stream; name=v2-0001-Fix-vcregress-plpython3-warnings.patchDownload
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 29086ca..88dff26 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -347,7 +347,7 @@ sub mangle_plpython3
s/([ [{])u'/$1'/g;
s/def next/def __next__/g;
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
- s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
+ s/EXTENSION (\S*?)plpython2?u/EXTENSION $1plpython3u/g;
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
}
for ($contents);
On 1/10/22 06:53, Juan José Santamaría Flecha wrote:
On Mon, Jan 10, 2022 at 12:51 PM Juan José Santamaría Flecha
<juanjo.santamaria@gmail.com> wrote:Please find attached a patch for so.
The patch.
Pushed, and backpatched.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com