android_mt6572_jiabo/external/autotest/client/virt/virt_installer.py
2025-09-05 16:56:03 +08:00

23 lines
717 B
Python

import os, shutil, logging
from autotest_lib.client.bin import utils
def check_configure_options(script_path):
"""
Return the list of available options (flags) of a GNU autoconf like
configure build script.
@param script: Path to the configure script
"""
abspath = os.path.abspath(script_path)
help_raw = utils.system_output('%s --help' % abspath, ignore_status=True)
help_output = help_raw.split("\n")
option_list = []
for line in help_output:
cleaned_line = line.lstrip()
if cleaned_line.startswith("--"):
option = cleaned_line.split()[0]
option = option.split("=")[0]
option_list.append(option)
return option_list