From: Simon Ruderich Date: Wed, 16 Nov 2016 11:40:10 +0000 (+0100) Subject: Support new dpkg versions which use debarch_to_debtuple X-Git-Tag: 0.08~15 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=bf419763b81c704b86244b0b7f0e92dda492af8a;p=blhc%2Fblhc.git Support new dpkg versions which use debarch_to_debtuple --- diff --git a/NEWS b/NEWS index fff2e79..1638007 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,13 @@ NEWS ==== +Version 0.XX +------------ + +- Support new dpkg versions which replaced Dpkg::Arch's debarch_to_debtriplet + with debarch_to_debtuple (Debian Bug #844393), reported by Johannes Schauer. + + Version 0.07 ------------ 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)$/