X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;h=fa9a07c8dce590a4a9a7e7f55327d7e76b4b0253;hp=accb99fbff8226aa42fb55ed423a9e32b40d3710;hb=bf419763b81c704b86244b0b7f0e92dda492af8a;hpb=1f0f2245c634fbff897af580e0a20df68ba59937 diff --git a/bin/blhc b/bin/blhc index accb99f..fa9a07c 100755 --- a/bin/blhc +++ b/bin/blhc @@ -1022,14 +1022,21 @@ foreach my $file (@ARGV) { # Option or auto detected. if ($arch) { - # The following was partially copied from dpkg-dev 1.18.10 + # The following was partially copied from dpkg-dev 1.18.15 # (/usr/share/perl5/Dpkg/Vendor/Debian.pm, _add_hardening_flags()), # copyright Raphaël Hertzog , Kees Cook # , Canonical, Ltd. licensed under GPL version 2 or # later. Keep it in sync. require Dpkg::Arch; - my ($abi, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch); + my ($os, $cpu); + # Recent dpkg versions use a quadruplet for arch. Support both. + eval { + (undef, undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtuple($arch); + }; + if ($@) { + (undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch); + } # Disable unsupported hardening options. if ($os !~ /^(?:linux|kfreebsd|knetbsd|hurd)$/