]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Support new dpkg versions which use debarch_to_debtuple
authorSimon Ruderich <simon@ruderich.org>
Wed, 16 Nov 2016 11:40:10 +0000 (12:40 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 16 Nov 2016 11:40:10 +0000 (12:40 +0100)
NEWS
bin/blhc

diff --git a/NEWS b/NEWS
index fff2e790c3f9b4acdc86b086e30c85f065cd9511..16380075002898db03ed39cf0277bb11b7fd2827 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 NEWS
 ====
 
 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
 ------------
 
 Version 0.07
 ------------
 
index accb99fbff8226aa42fb55ed423a9e32b40d3710..fa9a07c8dce590a4a9a7e7f55327d7e76b4b0253 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -1022,14 +1022,21 @@ foreach my $file (@ARGV) {
 
     # Option or auto detected.
     if ($arch) {
 
     # 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 <hertzog@debian.org>, Kees Cook
         # <kees@debian.org>, Canonical, Ltd. licensed under GPL version 2 or
         # later. Keep it in sync.
 
         require Dpkg::Arch;
         # (/usr/share/perl5/Dpkg/Vendor/Debian.pm, _add_hardening_flags()),
         # copyright Raphaël Hertzog <hertzog@debian.org>, Kees Cook
         # <kees@debian.org>, 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)$/
 
         # Disable unsupported hardening options.
         if ($os !~ /^(?:linux|kfreebsd|knetbsd|hurd)$/