[dpkg] 32/200: Dpkg::Vendor::Debian: Use a hash instead of a long regex

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit 5c33a429eb77b4a7baffce88161caa2274c9edd8
Author: Guillem Jover <guillem at debian.org>
Date:   Fri Nov 11 04:22:52 2016 +0100

    Dpkg::Vendor::Debian: Use a hash instead of a long regex
    
    Addresses RegularExpressions::RequireExtendedFormatting.
    
    Warned-by: perlcritic
---
 scripts/Dpkg/Vendor/Debian.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index e4ba2e0..8ab8ffd 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -293,8 +293,12 @@ sub _add_hardening_flags {
         pie => 1,
     );
 
+    my %builtin_pie_arch = map { $_ => 1 } qw(
+        amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x
+    );
+
     # Mask builtin features that are not enabled by default in the compiler.
-    if ($arch !~ /^(?:amd64|arm64|armel|armhf|i386|mips|mipsel|mips64el|ppc64el|s390x)$/) {
+    if (not exists $builtin_pie_arch{$arch}) {
         $builtin_feature{pie} = 0;
     }
 

-- 
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