Skip to content

Commit 371f590

Browse files
hdlee27Kwang-Hui
authored andcommitted
remove unnecessary submodup update attempt in setup.py
- some bsp don't need to update submodule (cherry-picked from a4d1146) Signed-off-by: Hyundo Lee <54927573+hdlee27@users.noreply.github.com>
1 parent d598e67 commit 371f590

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@ def find_setup_script(bsp_name):
3737
print_usage()
3838
exit()
3939

40-
4140
def update_submodule(path):
42-
if (path and os.path.isdir(path)):
43-
cwd = os.getcwd()
41+
cwd = os.getcwd()
42+
try:
43+
print("Update submodule " + path)
4444
os.system("git submodule sync " + path)
4545
os.system("git submodule init " + path)
4646
os.system("git submodule update " + path)
4747
os.chdir(path)
4848
os.system("git reset --hard HEAD")
49-
os.chdir(cwd)
50-
else:
49+
except:
5150
print("Failed to update submodule " + path)
52-
51+
os.chdir(cwd)
5352

5453
update_submodule(STDK_CORE_PATH)
5554

@@ -67,7 +66,8 @@ def update_submodule(path):
6766
setup_script = find_setup_script(BSP_NAME)
6867

6968
BSP_PATH = os.path.join(STDK_REF_PATH, "bsp", BSP_NAME)
70-
update_submodule(BSP_PATH)
69+
if BSP_PATH and os.path.isdir(BSP_PATH):
70+
update_submodule(BSP_PATH)
7171

7272
setup_cmd = setup_script + " " + BSP_NAME
7373
for args in EXTRA_ARGS:

0 commit comments

Comments
 (0)