[dpkg] 167/187: Test::Dpkg: Use x modifier on a long regex
Reiner Herrmann
reiner at reiner-h.de
Sun Nov 6 12:46:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch master
in repository dpkg.
commit e169dfcb236facb0cce6a6153178e11dbdcd1e0e
Author: Guillem Jover <guillem at debian.org>
Date: Fri Nov 4 03:25:22 2016 +0100
Test::Dpkg: Use x modifier on a long regex
Addresses RegularExpressions::RequireExtendedFormatting.
Warned-by: perlcritic
---
scripts/Test/Dpkg.pm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm
index 5dc8732..ff60df1 100644
--- a/scripts/Test/Dpkg.pm
+++ b/scripts/Test/Dpkg.pm
@@ -111,7 +111,24 @@ sub test_neutralize_checksums
open my $fh, '<', $filename or die;
while (<$fh>) {
s/^ ([0-9a-f]{32,}) [1-9][0-9]* /q{ } . $1 =~ tr{0-9a-f}{0}r . q{ 0 }/e;
- s/^( 0{32,} 0(?: [\w]* [\w]*)? [^_]*_[^_]*)_[^.]*\.(buildinfo)$/$1_20160101T123000z-00000000.$2/;
+ s{^
+ (
+ \s
+ # Digest
+ 0{32,}
+ \s
+ # Size
+ 0
+ # Optional Section and Priority
+ (?:\s[\w]*\s[\w]*)?
+ \s
+ # Filename (package and version)
+ [^_]*_[^_]*
+ )
+ # Filename (architecture and extension)
+ _[^.]*\.(buildinfo)
+ $
+ }{$1_20160101T123000z-00000000.$2}x;
print { $fhnew } $_;
}
close $fh or die;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list