Просмотр исходного кода

dpkg-buildflags: Handle unknown architectures gracefully

Give a warning and reset the abi-os-cpu tuple to empty strings.

Closes: #663004
Guillem Jover лет назад: 14
Родитель
Сommit
4cc8a1748f
2 измененных файлов с 7 добавлено и 0 удалено
  1. 2 0
      debian/changelog
  2. 5 0
      scripts/Dpkg/Vendor/Debian.pm

+ 2 - 0
debian/changelog

@@ -60,6 +60,8 @@ dpkg (1.16.2) UNRELEASED; urgency=low
   * Relax --merge-avail Packages file parser, to not fail on bogus versions.
   * When building only arch-indep binaries with «dpkg-buildpackage -A», name
     the .changes file using ‘all’ as architecture. Closes: #661638
+  * Handle unknown architectures gracefully in dpkg-buildflags.
+    Closes: #663004
 
   [ Raphaël Hertzog ]
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building

+ 5 - 0
scripts/Dpkg/Vendor/Debian.pm

@@ -83,6 +83,11 @@ sub add_hardening_flags {
     my $arch = get_host_arch();
     my ($abi, $os, $cpu) = debarch_to_debtriplet($arch);
 
+    unless (defined $abi and defined $os and defined $cpu) {
+        warning(_g("unknown host architecture '%s'"), $arch);
+        ($abi, $os, $cpu) = ("", "", "");
+    }
+
     # Features enabled by default for all builds.
     my %use_feature = (
 	"pie" => 0,