-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
u-boot: check the produced platform_install.sh
(created from functions like write_uboot_platform) for shellcheck errors
#7509
u-boot: check the produced platform_install.sh
(created from functions like write_uboot_platform) for shellcheck errors
#7509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is using local not good?
unclear what you're asking here? what local, what good? |
I assume the question was about why |
Yes, local variable in function vs global. Probably makes no diff. just asking if there is a reasoning for this. |
That's not about local vs global. That's about the logic and specially the error control flow. A statement with The return value ("success") of the Now for such simple ( local part=$(findfs PARTUUID=$tmp 2> /dev/null) # always works, even if findfs failed So here, if Thus one can separate the declaration of the variable scope in a statement, and the assignment in another, so the errors are not hidden. local part # always works
part=$(findfs PARTUUID=$tmp 2> /dev/null) # will fail if findfs fails I just realized I wrote a bad version of https://www.shellcheck.net/wiki/SC2155 so go read that instead. Finally, why sometimes |
…ons like write_uboot_platform) for shellcheck errors - we've some smelly stuff in write_uboot_platform for some families that we'd rather catch early - implement small syntax fixes in setup_write_uboot_platform
7b785cc
to
d03771d
Compare
Has a full check of this code been done? |
Which device? I've tested the ones I have (rockchip64 and meson64). |
u-boot: check the produced
platform_install.sh
(created from functions like write_uboot_platform) for shellcheck errorsplatform_install.sh
(created from functions like write_uboot_platform) for shellcheck errors