History

builddeb: Change architecture detection fallback to use dpkg-architecture

We currently use dpkg --print-architecture, which reports the architecture of the build machine. We can make a better guess than this by asking dpkg-architecture what the host architecture, i.e. the default architecture for building packages, is. This is sensitive to environment variables such as CC and DEB_HOST_ARCH, which should already be set in a cross-build environment.

Ben Hutchings committed 8 years ago

Commit 091d30a1 parent f2abcc11 file · +2 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/package/mkdebian+2−2
@@ -42,13 +42,13 @@ set_debarch() { · 41 unmodified lines
42 fi42 fi
43 ;;43 ;;
44 *)44 *)
45 debarch=$(dpkg --print-architecture)45 debarch=$(dpkg-architecture -qDEB_HOST_ARCH)
46 echo "" >&246 echo "" >&2
47 echo "** ** ** WARNING ** ** **" >&247 echo "** ** ** WARNING ** ** **" >&2
48 echo "" >&248 echo "" >&2
49 echo "Your architecture doesn't have its equivalent" >&249 echo "Your architecture doesn't have its equivalent" >&2
50 echo "Debian userspace architecture defined!" >&250 echo "Debian userspace architecture defined!" >&2
51 echo "Falling back to using your current userspace instead!" >&251 echo "Falling back to the current host architecture ($debarch)." >&2
52 echo "Please add support for $UTS_MACHINE to ${0} ..." >&252 echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
53 echo "" >&253 echo "" >&2
54 ;;54 ;;