mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] host-intltool: fix intltool-update unescaped left brace in regex
@ 2017-08-31 11:45 Ian Abbott
  2017-09-04 11:06 ` Robert Schwebel
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Abbott @ 2017-08-31 11:45 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

intltool-update from intltool-0.50.0 doesn't work with Perl 5.26 (and
possibly other versions later than Perl 5.22), due to "Unescaped left
brace in regex is illegal here" errors.  In Perl 5.22 this resulted in
warnings, but they have since been promoted to errors.

For example, building "avahi" fails at the "prepare" stage:

checking for intltool >= 0.35.0... Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at /home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/sysroot-host/bin/intltool-update line 1064.
 found
configure: error: Your intltool is too old.  You need intltool 0.35.0 or later.
/mnt/lindata/work/abbotti/ptxdist/ptxdist/ptxdist_git/ptxdist/rules/post/ptxd_make_world_prepare.make:12: recipe for target '/home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/state/avahi.prepare' failed
make: *** [/home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/state/avahi.prepare] Error 1

Apply the same patch as in the mainstream Linux distros to fix it.

Note that if PTXdist updates host-intltool to version 0.51.0, it will
need the same patch.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 patches/intltool-0.50.0/intltool-perl-5.22.patch | 43 ++++++++++++++++++++++++
 patches/intltool-0.50.0/series                   |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 patches/intltool-0.50.0/intltool-perl-5.22.patch
 create mode 100644 patches/intltool-0.50.0/series

diff --git a/patches/intltool-0.50.0/intltool-perl-5.22.patch b/patches/intltool-0.50.0/intltool-perl-5.22.patch
new file mode 100644
index 000000000..a23946b39
--- /dev/null
+++ b/patches/intltool-0.50.0/intltool-perl-5.22.patch
@@ -0,0 +1,43 @@
+--- a/intltool-update.in	2015-03-09 02:39:54.000000000 +0100
++++ b/intltool-update.in	2015-09-01 11:43:40.595517191 +0200
+@@ -1062,7 +1062,7 @@
+ 	}
+     }
+ 
+-    if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
++    if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
+     {
+ 	my $rest = $3;
+ 	my $untouched = $1;
+@@ -1190,10 +1190,10 @@
+ 	$name    =~ s/\(+$//g;
+ 	$version =~ s/\(+$//g;
+ 
+-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
+     }
+ 
+     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
+@@ -1219,11 +1219,11 @@
+ 	$version =~ s/\(+$//g;
+         $bugurl  =~ s/\(+$//g if (defined $bugurl);
+ 
+-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+-        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
++        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
+     }
+ 
+     # \s makes this not work, why?
diff --git a/patches/intltool-0.50.0/series b/patches/intltool-0.50.0/series
new file mode 100644
index 000000000..f0f2827c4
--- /dev/null
+++ b/patches/intltool-0.50.0/series
@@ -0,0 +1 @@
+intltool-perl-5.22.patch
-- 
2.14.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] host-intltool: fix intltool-update unescaped left brace in regex
  2017-08-31 11:45 [ptxdist] [PATCH] host-intltool: fix intltool-update unescaped left brace in regex Ian Abbott
@ 2017-09-04 11:06 ` Robert Schwebel
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Schwebel @ 2017-09-04 11:06 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

On Thu, Aug 31, 2017 at 12:45:16PM +0100, Ian Abbott wrote:
> intltool-update from intltool-0.50.0 doesn't work with Perl 5.26 (and
> possibly other versions later than Perl 5.22), due to "Unescaped left
> brace in regex is illegal here" errors.  In Perl 5.22 this resulted in
> warnings, but they have since been promoted to errors.
> 
> For example, building "avahi" fails at the "prepare" stage:
> 
> checking for intltool >= 0.35.0... Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at /home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/sysroot-host/bin/intltool-update line 1064.
>  found
> configure: error: Your intltool is too old.  You need intltool 0.35.0 or later.
> /mnt/lindata/work/abbotti/ptxdist/ptxdist/ptxdist_git/ptxdist/rules/post/ptxd_make_world_prepare.make:12: recipe for target '/home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/state/avahi.prepare' failed
> make: *** [/home/abbotti/work/ptxdist/projects/dbpod-socfpga-tmp/platform-dbpod-fastpod/state/avahi.prepare] Error 1
> 
> Apply the same patch as in the mainstream Linux distros to fix it.
> 
> Note that if PTXdist updates host-intltool to version 0.51.0, it will
> need the same patch.

For the record, here are some upstream bugreports:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788705
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826471
https://bugs.launchpad.net/intltool/+bug/1490906
 
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  patches/intltool-0.50.0/intltool-perl-5.22.patch | 43 ++++++++++++++++++++++++
>  patches/intltool-0.50.0/series                   |  1 +
>  2 files changed, 44 insertions(+)
>  create mode 100644 patches/intltool-0.50.0/intltool-perl-5.22.patch
>  create mode 100644 patches/intltool-0.50.0/series
> 
> diff --git a/patches/intltool-0.50.0/intltool-perl-5.22.patch b/patches/intltool-0.50.0/intltool-perl-5.22.patch
> new file mode 100644
> index 000000000..a23946b39
> --- /dev/null
> +++ b/patches/intltool-0.50.0/intltool-perl-5.22.patch
> @@ -0,0 +1,43 @@
> +--- a/intltool-update.in	2015-03-09 02:39:54.000000000 +0100
> ++++ b/intltool-update.in	2015-09-01 11:43:40.595517191 +0200
> +@@ -1062,7 +1062,7 @@
> + 	}
> +     }
> + 
> +-    if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
> ++    if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
> +     {
> + 	my $rest = $3;
> + 	my $untouched = $1;
> +@@ -1190,10 +1190,10 @@
> + 	$name    =~ s/\(+$//g;
> + 	$version =~ s/\(+$//g;
> + 
> +-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
> +-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
> +-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
> +-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
> ++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
> ++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
> ++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
> ++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
> +     }
> + 
> +     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
> +@@ -1219,11 +1219,11 @@
> + 	$version =~ s/\(+$//g;
> +         $bugurl  =~ s/\(+$//g if (defined $bugurl);
> + 
> +-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
> +-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
> +-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
> +-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
> +-        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
> ++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
> ++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
> ++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
> ++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
> ++        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
> +     }
> + 
> +     # \s makes this not work, why?
> diff --git a/patches/intltool-0.50.0/series b/patches/intltool-0.50.0/series
> new file mode 100644
> index 000000000..f0f2827c4
> --- /dev/null
> +++ b/patches/intltool-0.50.0/series
> @@ -0,0 +1 @@
> +intltool-perl-5.22.patch
> -- 
> 2.14.1
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-04 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31 11:45 [ptxdist] [PATCH] host-intltool: fix intltool-update unescaped left brace in regex Ian Abbott
2017-09-04 11:06 ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox