#
# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
#
-# $Id$
#
# Author: Lorenzo Berni <duplo@develer.com>
#
def validateToolchain(toolchain):
if not os.path.exists(toolchain):
- return False, {}
+ return {}
for tool in TOOLCHAIN_ITEMS:
- if not os.path.exists(toolchain.replace("gcc", tool)):
- return False, {}
+ toolchainpre = toolchain.rsplit("gcc", 1)[0]
+ toolchainpost = toolchain.rsplit("gcc", 1)[1]
+ if not os.path.exists(toolchainpre + tool + toolchainpost):
+ return {}
validation_process = QProcess()
validation_process.start(toolchain, ["-v"])
validation_process.waitForStarted(1000)
if validation_process.waitForFinished(200):
description = unicode(validation_process.readAllStandardError())
info = bertos_utils.getToolchainInfo(description)
- print info
if len(info) >= 4:
- return True, info
+ return info
else:
- return False, {}
+ return {}
else:
validation_process.kill()
- return False, {}
+ return {}