return not missing_requirements
-def get_toolchain_configs(toolchains_url):
+def get_toolchain_configs(toolchains_csv, buildrootdir):
"""Fetch and return the possible toolchain configurations
This function returns an array of toolchain configurations. Each
toolchain configuration is itself an array of lines of the defconfig.
"""
- with urlopen_closing(toolchains_url) as r:
- toolchains_csv = decode_byte_list(r.readlines())
+ with open(toolchains_csv) as r:
+ toolchains = decode_byte_list(r.readlines())
configs = []
(_, _, _, _, hostarch) = os.uname()
if hostarch == 'i686' or hostarch == 'i386' or hostarch == 'x86':
hostarch = 'x86'
- for row in csv.reader(toolchains_csv):
+ for row in csv.reader(toolchains):
config = {}
- url = row[0]
+ configfile = row[0]
config_hostarch = row[1]
keep = False
if not keep:
continue
- with urlopen_closing(url) as r:
- config = decode_byte_list(r.readlines())
+ if not os.path.isabs(configfile):
+ configfile = os.path.join(buildrootdir, configfile)
+
+ with open(configfile) as r:
+ config = r.readlines()
configs.append(config)
return configs
"""
# Select a random toolchain configuration
- configs = get_toolchain_configs(args.toolchains_url)
+ configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
i = randint(0, len(configs) - 1)
toolchainconfig = configs[i]
parser.add_argument("--buildrootdir", "-b",
help="Buildroot directory (relative to current directory)",
type=str, default='.')
- parser.add_argument("--toolchains-url",
- help="URL of toolchain configuration file",
+ parser.add_argument("--toolchains-csv",
+ help="Path of the toolchain configuration file",
type=str,
- default="http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv")
+ default="support/config-fragments/autobuild/toolchain-configs.csv")
args = parser.parse_args()
# We need the absolute path to use with O=, because the relative