diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index e8d85bc..6a9679d 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -487,6 +487,14 @@ Build a deb. sub build { my $this=shift; + + # Detect architecture mismatch and abort with a comprehensible + # error message. + my $arch=$this->arch; + my $ret=system("dpkg-architecture", "-i".$arch); + if ($ret != 0) { + die $this->filename." is for architecture ".$this->arch." ; the package cannot be built on this system"."\n"; + } chdir $this->unpacked_tree; my $log=$this->runpipe(1, "debian/rules binary 2>&1"); diff --git a/debian/changelog b/debian/changelog index a2e5d8a..eca4421 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ alien (8.82) UNRELEASED; urgency=low * Use debhelper compat level v7 when building packages. All changes since v4 seem safe for alien's generated rules files. * Use dh_prep instead of deprecated dh_clean -k. + * Print a nice error message when attempting to build a deb from a package + of an unsupported architecture. Closes: #592625 -- Joey Hess Sun, 23 May 2010 18:55:14 -0400