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 byos.uname()) and translates it into one of the machine architecture labels used in the Debian packaging system:Machine architecture
Debian architecture
i686i386x86_64amd64armv6larmhfWhen the machine architecture is not listed above, this function falls back to the external command
dpkg-architecture -qDEB_BUILD_ARCH(provided by thedpkg-devpackage). This command is not used by default because:deb-pkg-tools doesn’t have a strict dependency on
dpkg-dev.The
dpkg-architectureprogram 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:
ExternalCommandFailedwhen thedpkg-architectureprogram is not available or reports an error.