# (/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);
+ }