From 6128ee1035d4f3b8c5928bc86f2ca5b23d88cefd Mon Sep 17 00:00:00 2001 From: Willie Walker Date: Wed, 12 Apr 2017 19:06:08 -0400 Subject: [PATCH 1/2] Do not clone mbed-os if in a subdirectory --- mbed/mbed.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mbed/mbed.py b/mbed/mbed.py index 8354a44e..f6047402 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1116,6 +1116,12 @@ def getlibs(self): for f in files: if f.endswith('.lib') or f.endswith('.bld'): + # If we are in a subdirectory that is importing mbed-os, + # skip the import of mbed-os: the app will have already + # imported mbed-os. + if (f == 'mbed-os.lib') and (root != cwd_root): + action("Skipping redundant import of mbed-os in \"%s\"" % self.path) + continue repo = Repo.fromlib(os.path.join(root, f)) if repo: yield repo From b1fe8a6926b8d3317c8d77967ce8349052b3c6c6 Mon Sep 17 00:00:00 2001 From: Willie Walker Date: Wed, 12 Apr 2017 19:11:37 -0400 Subject: [PATCH 2/2] Elminate command line noise --- mbed/mbed.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mbed/mbed.py b/mbed/mbed.py index f6047402..65d57900 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1120,7 +1120,6 @@ def getlibs(self): # skip the import of mbed-os: the app will have already # imported mbed-os. if (f == 'mbed-os.lib') and (root != cwd_root): - action("Skipping redundant import of mbed-os in \"%s\"" % self.path) continue repo = Repo.fromlib(os.path.join(root, f)) if repo: