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
Minor fixes to pass shellcheck #14996
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ CFG=$1 | |
[ -n "$CFG" ] || CFG=/etc/board.json | ||
|
||
[ -d "/etc/board.d/" -a ! -s "$CFG" ] && { | ||
for a in $(ls /etc/board.d/*); do | ||
[ -s $a ] || continue; | ||
for a in /etc/board.d/*; do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be awfully tempted to substitute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which would not yield equivalent results though, as it returns While generally preferring |
||
[ -s "$a" ] || continue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though it is unlikely for files in |
||
$(. $a) | ||
done | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
/sbin/jffs2reset $@ | ||
/sbin/jffs2reset "$@" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First commit looks simple and reasonable. The subject line (first line used by shortlog) should be prefixed with "base-files:". |
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.
While I agree with this change, is there any reason why someone would want to do
ls <some glob>
? Probably this is done becausels
guarantees that they are sorted which makes sense in this context.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.
P.S. it does seem like
echo /etc/board.d/*
is sorted, but thels
man page explicitly mentions that the output would be sorted by default. I'm not sure if we can rely on it for glob.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.
The commit message for when this was introduced didn't shed any light on this. I think @rany2 almost certainly has the right of it though.
$(ls /etc/board.d/*)
is used since it gives the files in sorted order. A favorite approach is to name the scripts0-first-script.sh
,1-second-script.sh
,2-third-script.sh
, etc in order to ensure ordering of the scripts. Same idea as patch filenames starting with 3 digits. As a result this first line is almost certainly wrong.