debian_inspector.utils module

debian_inspector.utils.find_debian_architecture()

Find the Debian architecture of the current environment.

Uses os.uname() to determine the current machine architecture (the fifth value returned by os.uname()) and translates it into one of the machine architecture labels used in the Debian packaging system:

Machine architecture

Debian architecture

i686

i386

x86_64

amd64

armv6l

armhf

When the machine architecture is not listed above, this function falls back to the external command dpkg-architecture -qDEB_BUILD_ARCH (provided by the dpkg-dev package). This command is not used by default because:

  1. deb-pkg-tools doesn’t have a strict dependency on dpkg-dev.

  2. The dpkg-architecture program enables callers to set the current architecture and the exact semantics of this are unclear to me at the time of writing (it can’t automagically provide a cross compilation environment, so what exactly does it do?).

Returns:

The Debian architecture (a string like i386, amd64, armhf, etc).

Raises:

ExternalCommandFailed when the dpkg-architecture program is not available or reports an error.