@@ -857,7 +857,7 @@ def submodules():
857857
858858 cmds = [
859859 [f'export "IDF_PATH={ os .path .abspath (idf_path )} "' ],
860- ['cd' , idf_path ],
860+ ['cd' , os . path . abspath ( idf_path ) ],
861861 ['./install.sh' , 'all' ]
862862 ]
863863
@@ -870,36 +870,38 @@ def submodules():
870870 if result != 0 :
871871 sys .exit (result )
872872
873- env , cmds = setup_idf_environ ()
873+ cmds = []
874874
875- wifi_lib = os .path .abspath (
876- os .path .join (idf_path , 'components/esp_wifi/lib' )
877- )
878- berkeley_db = os .path .abspath ('lib/micropython/lib/berkeley-db-1.xx/README' )
879-
880- if not os .path .exists (berkeley_db ) or not os .path .exists (wifi_lib ):
881- cmds .append (['cd lib/micropython' ])
882- for dep in (
883- 'tinyusb' ,
884- 'micropython-lib' ,
885- 'protobuf-c' ,
886- 'wiznet5k' ,
887- 'lwip' ,
888- 'mbedtls' ,
889- 'axtls' ,
890- 'berkeley-db-1.xx' ,
891- 'btstack'
892- ):
893- path = f"lib/{ dep } "
875+ for name , file in (
876+ ('berkeley-db-1.xx' , 'README' ),
877+ ('mbedtls' , 'README.md' ),
878+ ('micropython-lib' , 'README.md' ),
879+ ('tinyusb' , 'README.rst' )
880+ ):
881+ file = os .path .join ('lib/micropython/lib' , name , file )
882+ if not os .path .exists (file ):
883+ cmds .extend ([
884+ [f'git submodule sync lib/{ name } ' ],
885+ [f'git submodule update --init --depth=1 lib/{ name } ' ]
886+ ])
887+ if cmds :
888+ cmds .insert (0 , ['cd lib/micropython' ])
889+ cmds .append (['cd ../..' ])
890+
891+ cmds .insert (0 , [f'cd { SCRIPT_DIR } ' ])
892+ cmds .insert (0 , ['. ./export.sh' ])
893+ cmds .insert (0 , ['cd' , os .path .abspath (idf_path )])
894+
895+ if 'GITHUB_RUN_ID' in os .environ :
896+ cmds .insert (0 , [f'export "IDF_PATH={ os .path .abspath (idf_path )} "' ])
897+
898+ cmds .append (submodules_cmd [:])
899+
900+ return_code , _ = spawn (cmds , env = env )
901+ if return_code != 0 :
902+ sys .exit (return_code )
894903
895- cmds .append ([f'git submodule sync { path } ' ])
896- cmds .append ([f'git submodule update --init --depth=1 { path } ' ])
897904
898- return_code , _ = spawn (cmds , env = env )
899- if return_code != 0 :
900- sys .exit (return_code )
901-
902-
903905def find_esp32_ports (chip ):
904906 from esptool .targets import CHIP_DEFS # NOQA
905907 from esptool .util import FatalError # NOQA
@@ -977,10 +979,7 @@ def update_panic_handler():
977979 if '"MPY version : "' in data :
978980 beg , end = data .split ('"MPY version : "' , 1 )
979981 end = end .split ('"\\ r\\ n"' , 1 )[1 ]
980- data = (
981- f'{ beg } "LVGL MPY version : 1.23.0 on " '
982- f'MICROPY_BUILD_DATE MICROPY_BUILD_TYPE_PAREN "\\ r\\ n"{ end } '
983- )
982+ data = f'{ beg } "LVGL MicroPython \\ r\\ n"{ end } '
984983
985984 write_file (PANICHANDLER_PATH , data )
986985
0 commit comments