Skip to content

Commit 178e96d

Browse files
committed
Fix integration with online tools
1 parent 4e747af commit 178e96d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

workspace_tools/export/exporters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from zipfile import ZipFile, ZIP_DEFLATED
77

88
from workspace_tools.toolchains import TOOLCHAIN_CLASSES
9+
from workspace_tools.targets import TARGET_MAP
910

1011
class OldLibrariesException(Exception): pass
1112

@@ -17,7 +18,7 @@ def __init__(self, target, inputDir, program_name, build_url_resolver):
1718
self.inputDir = inputDir
1819
self.target = target
1920
self.program_name = program_name
20-
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](target)
21+
self.toolchain = TOOLCHAIN_CLASSES[self.TOOLCHAIN](TARGET_MAP[target])
2122
self.build_url_resolver = build_url_resolver
2223

2324
def __scan_and_copy(self, src_path, trg_path):

workspace_tools/toolchains.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232

3333

3434
def print_notify(event):
35-
if event['type'] == 'info':
35+
# Default command line notification
36+
if event['type'] in ['info', 'debug']:
3637
print event['message']
3738

3839
elif event['type'] == 'cc':
@@ -387,7 +388,7 @@ def debug(self, message):
387388
if self.VERBOSE:
388389
if type(message) is ListType:
389390
message = ' '.join(message)
390-
self.info(message)
391+
self.notify({'type': 'debug', 'message': message})
391392

392393
def cc_info(self, severity, file, line, message):
393394
self.notify({'type': 'cc', 'severity': severity, 'file': file, 'line': line, 'message': message})

workspace_tools/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ def cmd(l, check=True, verbose=False, shell=False, cwd=None):
1818

1919
def run_cmd(command, wd=None, chroot=None):
2020
if chroot:
21+
# Conventions managed by the web team for the mbed.org build system
22+
if not wd:
23+
wd = '/src'
24+
else:
25+
wd = wd.replace(chroot, '')
2126
orig_cmd = ' '.join([c.replace(chroot, '') for c in command])
2227
command = []
2328
command.append('/usr/sbin/chroot')
2429
command.append(chroot)
25-
command.append('/bin/run.sh')
30+
command.append('/bin/run_v2.sh')
31+
command.append('%s'%wd)
2632
command.append('%s'%orig_cmd)
27-
2833
logging.debug("Running command %s"%' '.join(command))
2934
p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=chroot)
3035
else:

0 commit comments

Comments
 (0)