Bug#826497: metamonger: Unescaped left brace in regex is deprecated

2017-06-29 Thread gregor herrmann
Control: tag -1 + patch

On Sat, 24 Jun 2017 20:35:08 +0200, gregor herrmann wrote:

> This is fatal in Perl 5.26 (currently in experimental), making the
> package fail to build from source. Raising the severity accordingly.

I'm attaching a patch to fix this issue.


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Diana Krall: Temptation
diff -Nru metamonger-0.20150503/debian/changelog metamonger-0.20150503/debian/changelog
--- metamonger-0.20150503/debian/changelog	2015-05-03 15:19:48.0 +0200
+++ metamonger-0.20150503/debian/changelog	2017-06-30 00:41:37.0 +0200
@@ -1,3 +1,12 @@
+metamonger (0.20150503-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix "Unescaped left brace in regex is deprecated":
+add a patch to escape '{'s in regexps.
+(Closes: #826497)
+
+ -- gregor herrmann   Fri, 30 Jun 2017 00:41:37 +0200
+
 metamonger (0.20150503-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru metamonger-0.20150503/debian/patches/series metamonger-0.20150503/debian/patches/series
--- metamonger-0.20150503/debian/patches/series	1970-01-01 01:00:00.0 +0100
+++ metamonger-0.20150503/debian/patches/series	2017-06-30 00:41:37.0 +0200
@@ -0,0 +1 @@
+unescaped-left-brace-in-regex.patch
diff -Nru metamonger-0.20150503/debian/patches/unescaped-left-brace-in-regex.patch metamonger-0.20150503/debian/patches/unescaped-left-brace-in-regex.patch
--- metamonger-0.20150503/debian/patches/unescaped-left-brace-in-regex.patch	1970-01-01 01:00:00.0 +0100
+++ metamonger-0.20150503/debian/patches/unescaped-left-brace-in-regex.patch	2017-06-30 00:41:37.0 +0200
@@ -0,0 +1,75 @@
+Description: fix "Unescaped left brace in regex is deprecated" error
+ which is fatal in perl 5.26
+Origin: vendor
+Bug-Debian: https://bugs.debian.org/826497
+Author: gregor herrmann 
+Last-Update: 2017-06-30
+
+--- a/metamonger
 b/metamonger
+@@ -433,7 +433,7 @@
+ sub write_metadata_to_storage {
+ 	my ($file_metadata_ref) = @_;
+ 	my $json = to_json($file_metadata_ref, {canonical => 1});
+-	$json =~ s/"metadata":{/"metadata":{\n/;
++	$json =~ s/"metadata":\{/"metadata":{\n/;
+ 	$json =~ s/},/},\n/g;
+ 	if ($file_metadata_ref->{config}{strict_json} == 0) {
+ 		$json =~ s/}}}/},\n}}\n/g;
+--- a/t/009-save-noact.t
 b/t/009-save-noact.t
+@@ -13,8 +13,8 @@
+ 
+ my $output = `./metamonger --config=../files/config_empty save --no-act`;
+ 
+-ok $output =~ '"001":{"atime":1337,"mode":"0775","mtime":42}';
+-ok $output =~ /"004":{\S+,"mode":"0666",\S+}/;
++ok $output =~ '"001":\{"atime":1337,"mode":"0775","mtime":42}';
++ok $output =~ /"004":\{\S+,"mode":"0666",\S+}/;
+ 
+ 
+ 
+--- a/t/200-no-dereference.t
 b/t/200-no-dereference.t
+@@ -37,31 +37,31 @@
+ 
+ $output = `./metamonger --config=../files/config_empty save --no-act --no-dereference`;
+ 
+-ok $output =~ '"link":{"mtime":42}';
+-ok $output =~ '"original":{"mtime":1325376000}';
++ok $output =~ '"link":\{"mtime":42}';
++ok $output =~ '"original":\{"mtime":1325376000}';
+ 
+ 
+ $output = `./metamonger --config=../files/config_empty save --no-act -P`;
+ 
+-ok $output =~ '"link":{"mtime":42}';
+-ok $output =~ '"original":{"mtime":1325376000}';
++ok $output =~ '"link":\{"mtime":42}';
++ok $output =~ '"original":\{"mtime":1325376000}';
+ 
+ 
+ $output = `./metamonger --config=../files/config_empty save --no-act --dereference`;
+ 
+-ok $output =~ '"link":{"mtime":1325376000}';
+-ok $output =~ '"original":{"mtime":1325376000}';
++ok $output =~ '"link":\{"mtime":1325376000}';
++ok $output =~ '"original":\{"mtime":1325376000}';
+ 
+ $output = `./metamonger --config=../files/config_empty save --no-act -L`;
+ 
+-ok $output =~ '"link":{"mtime":1325376000}';
+-ok $output =~ '"original":{"mtime":1325376000}';
++ok $output =~ '"link":\{"mtime":1325376000}';
++ok $output =~ '"original":\{"mtime":1325376000}';
+ 
+ 
+ $output = `./metamonger --config=../files/config_empty save --no-act`;
+ 
+-ok $output =~ '"link":{"mtime":1325376000}';
+-ok $output =~ '"original":{"mtime":1325376000}';
++ok $output =~ '"link":\{"mtime":1325376000}';
++ok $output =~ '"original":\{"mtime":1325376000}';
+ 
+ 
+ rm_rf '../etc';


signature.asc
Description: Digital Signature


Bug#826497: metamonger: Unescaped left brace in regex is deprecated

2017-06-24 Thread gregor herrmann
severity 826497 important
user debian-p...@lists.debian.org
usertag 826497 + perl-5.26-transition
thanks

On Sun, 05 Jun 2016 22:21:00 +0300, Niko Tyni wrote:

> Package: metamonger
> Version: 0.20150503-1
> Severity: normal
> User: debian-p...@lists.debian.org
> Usertags: perl-5.24-transition
> 
> Building this package triggers deprecation warnings with Perl 5.24
> (currently in experimental), and probably with Perl 5.22 (current sid)
> too.
> 
>   Unescaped left brace in regex is deprecated, passed through in regex; 
> marked by <-- HERE in m/"001":{ <-- HERE 
> "atime":1337,"mode":"0775","mtime":42}/ at t/009-save-noact.t line 16.
>   Unescaped left brace in regex is deprecated, passed through in regex; 
> marked by <-- HERE in m/"004":{ <-- HERE \S+,"mode":"0666",\S+}/ at 
> t/009-save-noact.t line 17.
>   Unescaped left brace in regex is deprecated, passed through in regex; 
> marked by <-- HERE in m/"metadata":{ <-- HERE / at ./metamonger line 436.
> 
> It looks like './metamonger' is also installed in a binary package, so
> this probably has runtime effects too.

This is fatal in Perl 5.26 (currently in experimental), making the
package fail to build from source. Raising the severity accordingly.

A full build log is available at
  
http://perl.debian.net/rebuild-logs/perl-5.26-throwaway/metamonger_0.20150503-1/metamonger_0.20150503-1_amd64-2017-06-20T17:47:58Z.build

and the server also hosts a repository of packages binNMU'd for Perl
5.26 that can be used for testing purposes; see .


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Element of Crime: Wenn der Winter kommt


signature.asc
Description: Digital Signature


Bug#826497: metamonger: Unescaped left brace in regex is deprecated

2016-06-05 Thread Niko Tyni
Package: metamonger
Version: 0.20150503-1
Severity: normal
User: debian-p...@lists.debian.org
Usertags: perl-5.24-transition

Building this package triggers deprecation warnings with Perl 5.24
(currently in experimental), and probably with Perl 5.22 (current sid)
too.

  Unescaped left brace in regex is deprecated, passed through in regex; marked 
by <-- HERE in m/"001":{ <-- HERE "atime":1337,"mode":"0775","mtime":42}/ at 
t/009-save-noact.t line 16.
  Unescaped left brace in regex is deprecated, passed through in regex; marked 
by <-- HERE in m/"004":{ <-- HERE \S+,"mode":"0666",\S+}/ at t/009-save-noact.t 
line 17.
  Unescaped left brace in regex is deprecated, passed through in regex; marked 
by <-- HERE in m/"metadata":{ <-- HERE / at ./metamonger line 436.

It looks like './metamonger' is also installed in a binary package, so
this probably has runtime effects too.

A full build log is available at
  
http://perl.debian.net/rebuild-logs/perl-5.24-throwaway/metamonger_0.20150503-1/
-- 
Niko Tyni   nt...@debian.org