mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: ptxdist@pengutronix.de
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [ptxdist] [PATCH] host-intltool: fix intltool-update unescaped left brace in regex
Date: Thu, 31 Aug 2017 12:45:16 +0100	[thread overview]
Message-ID: <20170831114516.26472-1-abbotti@mev.co.uk> (raw)

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

             reply	other threads:[~2017-08-31 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 11:45 Ian Abbott [this message]
2017-09-04 11:06 ` Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831114516.26472-1-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox