mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +00:00
use grep instead of ~~ (smartmatch)
Patch by Kshitij Gupta <kgupta8592@gmail.com> A previous bugreport [1] was fixed using the smartmatch operator, which raised the minimum Perl version requirement to >=5.10.1 . However in Perl5.18 the smartmatch operator has again become "experimental" [2] so the following patch replace smartmatch operator with grep and thereby avoiding the requirement hike and avoiding warnings. [1] https://bugs.launchpad.net/apparmor/+bug/1180230 [2] http://blogs.perl.org/users/mike_b/2013/06/a-little-nicer-way-to-use-smartmatch-on-perl-518.html ACKed-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
parent
3b47558827
commit
d2d79c0777
@ -3879,7 +3879,7 @@ sub ask_the_questions() {
|
|||||||
$newpath =~ s/\/[^\/]+$/\/\*/;
|
$newpath =~ s/\/[^\/]+$/\/\*/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (not $newpath ~~ @options) {
|
if (not grep { $newpath eq $_ } @options) {
|
||||||
push @options, $newpath;
|
push @options, $newpath;
|
||||||
$defaultoption = $#options + 1;
|
$defaultoption = $#options + 1;
|
||||||
}
|
}
|
||||||
@ -3896,7 +3896,7 @@ sub ask_the_questions() {
|
|||||||
} else {
|
} else {
|
||||||
$newpath =~ s/\/[^\/]+(\.[^\/]+)$/\/\*$1/;
|
$newpath =~ s/\/[^\/]+(\.[^\/]+)$/\/\*$1/;
|
||||||
}
|
}
|
||||||
if (not $newpath ~~ @options) {
|
if (not grep { $newpath eq $_ } @options) {
|
||||||
push @options, $newpath;
|
push @options, $newpath;
|
||||||
$defaultoption = $#options + 1;
|
$defaultoption = $#options + 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user