[lintian] 01/01: Fix regex deprecation warnings with perl 5.22
This is an automated email from the git hooks/post-receive script.
broucaries-guest pushed a commit to branch master
in repository lintian.
commit 295f41e887e9d98f85d56cd89df521c7345b04c4
Author: bastien <roucaries.bastien+debian@gmail.com>
Date: Wed Jun 17 15:49:42 2015 +0200
Fix regex deprecation warnings with perl 5.22
---
checks/cruft.pm | 19 ++++++++++---------
checks/files.pm | 2 +-
checks/scripts.pm | 6 +++---
checks/version-substvars.pm | 2 +-
4 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/checks/cruft.pm b/checks/cruft.pm
index b47e147..7eee30f 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -1110,12 +1110,13 @@ sub _clean_block {
# po comment may include html tag
$text =~ s/\"\s?\v\#~\s?\"//gxms;
- $text =~ s/\\url{[^}]*?}/ /gxms; # (la)?tex url
- $text =~ s/\\emph{/ /gxms; # (la)?tex emph
- $text =~ s/\\href{[^}]*?}
- {([^}]*?)}/ $1 /gxms; # (la)?tex href
+ $text =~ s/\\url[{][^}]*?[}]/ /gxms; # (la)?tex url
+ $text =~ s/\\emph[{]/ /gxms; # (la)?tex emph
+ $text =~ s/\\href[{][^}]*?[}]
+ [{]([^}]*?)[}]/ $1 /gxms;# (la)?tex href
$text =~ s/\\hyperlink
- {[^}]*?}{([^}]*?)}/ $1 /gxms;# (la)?tex hyperlink
+ [{][^}]*?[}]
+ [{]([^}]*?)[}]/ $1 /gxms; # (la)?tex hyperlink
$text =~ s,-\\/,-,gxms; # tex strange hyphen
$text =~ s,\\char, ,gxms; # tex char command
@@ -1128,10 +1129,10 @@ sub _clean_block {
$text =~ s/\@c(?:omment)?\s+/ /gxms; # Tex info comment
# Tex info bold,italic, roman, fixed width
- $text =~ s/\@[birt]{/ /gxms;
- $text =~ s/\@sansserif{/ /gxms; # Tex info sans serif
- $text =~ s/\@slanted{/ /gxms; # Tex info slanted
- $text =~ s/\@var{/ /gxms; # Tex info emphasis
+ $text =~ s/\@[birt][{]/ /gxms;
+ $text =~ s/\@sansserif[{]/ /gxms; # Tex info sans serif
+ $text =~ s/\@slanted[{]/ /gxms; # Tex info slanted
+ $text =~ s/\@var[{]/ /gxms; # Tex info emphasis
$text =~ s/\@(?:small)?example\s+/ /gxms; # Tex info example
$text =~ s/\@end \h+
diff --git a/checks/files.pm b/checks/files.pm
index 1b3275d..8b0c571 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -116,7 +116,7 @@ my $VCS_FILES = Lintian::Data->new(
qr/\s++/,
sub {
my $regexp = $_[0];
- $regexp =~ s/\${COMPRESS_EXT}/$COMPRESS_FILE_EXTENSIONS_OR_ALL/g;
+ $regexp =~ s/\$[{]COMPRESS_EXT[}]/$COMPRESS_FILE_EXTENSIONS_OR_ALL/g;
return qr/(?:$regexp)/x;
});
diff --git a/checks/scripts.pm b/checks/scripts.pm
index f92b81a..2601d8f 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -98,7 +98,7 @@ my $BAD_MAINT_CMD = Lintian::Data->new(
fail 'Syntax error in scripts/maintainer-script-bad-command:', $.;
}
my ($incat,$exceptinpackage,$inscript,$regexp) = @sliptline;
- $regexp =~ s/\${LEADIN}/$LEADINSTR/;
+ $regexp =~ s/\$[{]LEADIN[}]/$LEADINSTR/;
# allow empty $exceptinpackage and set it synonymous to check in all package
$exceptinpackage
= defined($exceptinpackage) ? strip($exceptinpackage) : '';
@@ -914,7 +914,7 @@ sub run {
}
my $mode = /--remove/ ? 'remove' : 'add';
my ($divert) = /dpkg-divert\s*(.*)$/;
- $divert =~ s{\s*(?:\${?[\w:=-]+}?)*\s*
+ $divert =~ s{\s*(?:\$[{]?[\w:=-]+[}]?)*\s*
# options without arguments
--(?:add|quiet|remove|rename|test|local
# options with arguments
@@ -950,7 +950,7 @@ sub run {
# For now just replace variables, they will later be normalised
$expand_diversions = 1 if $divert =~ s/\\\$\w+/.+/g;
- $expand_diversions = 1 if $divert =~ s/\\\$\\{\w+.*?\\}/.+/g;
+ $expand_diversions = 1 if $divert =~ s/\\\$\\[{]\w+.*?\\[}]/.+/g;
# handle $() the same way:
$expand_diversions = 1 if $divert =~ s/\\\$\\\(.+?\\\)/.+/g;
diff --git a/checks/version-substvars.pm b/checks/version-substvars.pm
index 758f078..ba83f10 100644
--- a/checks/version-substvars.pm
+++ b/checks/version-substvars.pm
@@ -61,7 +61,7 @@ sub run {
my $rel = $info->binary_relation($pkg1, $field);
my $svid = 0;
my $visitor = sub {
- if (m/\${Source-Version}/o and not $svid) {
+ if (m/\$[{]Source-Version[}]/o and not $svid) {
$svid++;
tag 'substvar-source-version-is-deprecated', $pkg1;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: