Skip to content

Commit 07e003d

Browse files
committed
Added u-blox test repository
Also, allow a repository to synchronize with more than one source directory.
1 parent bdf5d03 commit 07e003d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

workspace_tools/synch.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
("CellularModem", "net/cellular/CellularModem"),
6363
("CellularUSBModem", "net/cellular/CellularUSBModem"),
6464
("UbloxUSBModem", "net/cellular/UbloxUSBModem"),
65+
("UbloxModemHTTPClientTest", ["tests/net/cellular/http/common", "tests/net/cellular/http/ubloxusbgsm"]),
6566
)
6667

6768

@@ -239,7 +240,7 @@ def visit_files(path, visit):
239240
visit(join(root, file))
240241

241242

242-
def update_repo(repo_name, sdk_path):
243+
def update_repo(repo_name, sdk_paths):
243244
repo = MbedOfficialRepository(repo_name)
244245
# copy files from mbed SDK to mbed_official repository
245246
def visit_mbed_sdk(sdk_file):
@@ -250,12 +251,16 @@ def visit_mbed_sdk(sdk_file):
250251
makedirs(repo_dir)
251252

252253
copy_with_line_endings(sdk_file, repo_file)
253-
visit_files(sdk_path, visit_mbed_sdk)
254+
for sdk_path in sdk_paths:
255+
visit_files(sdk_path, visit_mbed_sdk)
254256

255257
# remove repository files that do not exist in the mbed SDK
256258
def visit_repo(repo_file):
257-
sdk_file = join(sdk_path, relpath(repo_file, repo.path))
258-
if not exists(sdk_file):
259+
for sdk_path in sdk_paths:
260+
sdk_file = join(sdk_path, relpath(repo_file, repo.path))
261+
if exists(sdk_file):
262+
break
263+
else:
259264
remove(repo_file)
260265
print "remove: %s" % repo_file
261266
visit_files(repo.path, visit_repo)
@@ -267,7 +272,8 @@ def visit_repo(repo_file):
267272
def update_code(repositories):
268273
for repo_name, sdk_dir in repositories:
269274
print '\n=== Updating "%s" ===' % repo_name
270-
sdk_path = join(LIB_DIR, sdk_dir)
275+
sdk_dirs = [sdk_dir] if type(sdk_dir) != type([]) else sdk_dir
276+
sdk_path = [join(LIB_DIR, d) for d in sdk_dirs]
271277
update_repo(repo_name, sdk_path)
272278

273279

0 commit comments

Comments
 (0)