mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-14 20:01:07 +00:00
Use arch-test to determine local arch support
Will work with qemu-user-static, if installed
This commit is contained in:
parent
d3a7eac62f
commit
5856b6a41f
1
debian/control
vendored
1
debian/control
vendored
@ -76,6 +76,7 @@ Recommends:
|
||||
quilt,
|
||||
reportbug (>= 3.39ubuntu1),
|
||||
ubuntu-keyring | ubuntu-archive-keyring,
|
||||
arch-test
|
||||
Suggests:
|
||||
qemu-user-static,
|
||||
Description: useful tools for Ubuntu developers
|
||||
|
@ -29,7 +29,9 @@
|
||||
# configurations. For example, a symlink called pbuilder-hardy will assume
|
||||
# that the target distribution is always meant to be Ubuntu Hardy.
|
||||
|
||||
import distutils.spawn
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@ -440,11 +442,26 @@ def main():
|
||||
|
||||
if len(parts) > 2:
|
||||
requested_arch = parts[2]
|
||||
elif len(args) > 0 and args[0] in (
|
||||
'alpha', 'amd64', 'arm', 'armeb', 'armel', 'armhf', 'arm64',
|
||||
'i386', 'lpia', 'm68k', 'mips', 'mipsel', 'powerpc', 'ppc64',
|
||||
'ppc64el', 'riscv64', 's390x', 'sh4', 'sh4eb', 'sparc', 'sparc64'):
|
||||
requested_arch = args.pop(0)
|
||||
elif len(args) > 0:
|
||||
if distutils.spawn.find_executable('arch-test'):
|
||||
if subprocess.run(
|
||||
['arch-test', args[0]],
|
||||
stdout=subprocess.DEVNULL).returncode == 0:
|
||||
requested_arch = args.pop(0)
|
||||
elif (os.path.isdir('/usr/lib/arch-test')
|
||||
and args[0] in os.listdir('/usr/lib/arch-test/')):
|
||||
Logger.error('Architecture "%s" is not supported on your '
|
||||
'currently running kernal. Consider installing '
|
||||
'the qemu-user-static package to enable the use of '
|
||||
'foreign architectures.', args[0])
|
||||
sys.exit(1)
|
||||
else:
|
||||
requested_arch = None
|
||||
else:
|
||||
Logger.error('Cannot determine if "%s" is a valid architecture. '
|
||||
'Please install the arch-test package and retry.',
|
||||
args[0])
|
||||
sys.exit(1)
|
||||
else:
|
||||
requested_arch = None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user