env2mfile: Split detect_cross_debianlike()
Separating the part that runs dpkg-architecture from the part that interprets its results will make it easier to unit-test the latter. Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
parent
ed1d626c35
commit
6224a7f48e
|
@ -171,6 +171,9 @@ def detect_cross_debianlike(options: T.Any) -> MachineInfo:
|
|||
cmd = ['dpkg-architecture', '-a' + options.debarch]
|
||||
output = subprocess.check_output(cmd, universal_newlines=True,
|
||||
stderr=subprocess.DEVNULL)
|
||||
return dpkg_architecture_to_machine_info(output, options)
|
||||
|
||||
def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInfo:
|
||||
data = {}
|
||||
for line in output.split('\n'):
|
||||
line = line.strip()
|
||||
|
|
Loading…
Reference in New Issue