Fix integration with online tools

pull/3/head
Emilio Monti 2013-04-19 14:59:13 +01:00
parent 4e747af031
commit 178e96d65f
3 changed files with 12 additions and 5 deletions

View File

@ -6,6 +6,7 @@ from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
from workspace_tools.toolchains import TOOLCHAIN_CLASSES
from workspace_tools.targets import TARGET_MAP
class OldLibrariesException(Exception): pass
@ -17,7 +18,7 @@ class Exporter():
self.inputDir = inputDir
self.target = target
self.program_name = program_name
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](target)
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](TARGET_MAP[target])
self.build_url_resolver = build_url_resolver
def __scan_and_copy(self, src_path, trg_path):

View File

@ -32,7 +32,8 @@ IGNORE_DIRECTORIES = set(['CVS'])
def print_notify(event):
if event['type'] == 'info':
# Default command line notification
if event['type'] in ['info', 'debug']:
print event['message']
elif event['type'] == 'cc':
@ -387,7 +388,7 @@ class mbedToolchain:
if self.VERBOSE:
if type(message) is ListType:
message = ' '.join(message)
self.info(message)
self.notify({'type': 'debug', 'message': message})
def cc_info(self, severity, file, line, message):
self.notify({'type': 'cc', 'severity': severity, 'file': file, 'line': line, 'message': message})

View File

@ -18,13 +18,18 @@ def cmd(l, check=True, verbose=False, shell=False, cwd=None):
def run_cmd(command, wd=None, chroot=None):
if chroot:
# Conventions managed by the web team for the mbed.org build system
if not wd:
wd = '/src'
else:
wd = wd.replace(chroot, '')
orig_cmd = ' '.join([c.replace(chroot, '') for c in command])
command = []
command.append('/usr/sbin/chroot')
command.append(chroot)
command.append('/bin/run.sh')
command.append('/bin/run_v2.sh')
command.append('%s'%wd)
command.append('%s'%orig_cmd)
logging.debug("Running command %s"%' '.join(command))
p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=chroot)
else: