Closed greenbreakfast closed 1 year ago
After updates in PR #8, it looks like the prepare_sdk function will be called multiple times when onion_buildenv is called with the setup_sdk argument
prepare_sdk
setup_sdk
bash onion_buildenv setup_sdk
When the setup_sdk function is run
https://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L118-L124
It will call the update_package_feeds function and the prepare_sdk function.
update_package_feeds
However, the update_package_feeds function will ALSO call prepare_sdk (on line 108):
https://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L100-L111
⚠️ Resulting in prepare_sdk being run twice.
bash onion_buildenv update_sdk
The update_sdk doesn't have this issue:
update_sdk
https://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L113C15-L116
We should avoid running prepare_sdk twice since the feeds update and installation operations take quite a bit of time
Possible solutions:
Will leave this up to you @jempatel
Resolved in PR https://github.com/OnionIoT/openwrt-sdk-wrapper/pull/10 Closing this issue
Description
After updates in PR #8, it looks like the
prepare_sdk
function will be called multiple times when onion_buildenv is called with thesetup_sdk
argumentSteps to Reproduce
Running
bash onion_buildenv setup_sdk
When the
setup_sdk
function is runhttps://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L118-L124
It will call the
update_package_feeds
function and theprepare_sdk
function.However, the
update_package_feeds
function will ALSO callprepare_sdk
(on line 108):https://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L100-L111
⚠️ Resulting in
prepare_sdk
being run twice.Running
bash onion_buildenv update_sdk
-> No IssueThe
update_sdk
doesn't have this issue:https://github.com/OnionIoT/openwrt-sdk-wrapper/blob/65ea6c1c3f72278e15ff64ea1fec9b819348910c/onion_buildenv#L113C15-L116
Proposed Resolution
We should avoid running
prepare_sdk
twice since the feeds update and installation operations take quite a bit of timePossible solutions:
prepare_sdk
call fromupdate_package_feeds
, and addprepare_sdk
call toupdate_sdk
prepare_sdk
fromsetup_sdk
Will leave this up to you @jempatel