[LEDE-DEV] [patch master 00/15] shell code improvement for /scripts

Alberto Bursi alberto.bursi at outlook.it
Fri Sep 30 14:02:44 PDT 2016


I'm suspecting he did use shellcheck.net (or its local version, 
shellcheck) to find the errors.

That's a great tool to find all dumb mistakes and bad practices in scripts.

It's also opensource:

https://github.com/koalaman/shellcheck

-Alberto


On 09/30/2016 10:19 PM, John Crispin wrote:
>
> On 30/09/2016 22:02, Jan-Tarek Butt wrote:
>> Hi,
>>
>> I did some bugfixing and code quality improvement for
>> all shell scrips inside the dir ./scripts.
>>
>> cheers
>> Tarek
>
> Hi Tarek,
>
> did you manually generate these or did you use some semantic patching tools.
>
> 	John
>
>> Jan-Tarek Butt (15):
>>    Double quote to prevent globbing and word splitting
>>    code style: remove whitespaces on end of lines
>>    Add and fix a shebang
>>    $/${} is unnecessary on arithmetic variables
>>    Use cd ... || exit in case cd fails
>>    redirect matters, the 2>&1 has to be last.
>>    Quote to prevent word splitting
>>    Use $(..) instead of legacy `..`
>>    Argument mixes string and array. Use $*
>>    quote literal {
>>    Consider using { cmd1; cmd2; } >> file instead of individual redirects
>>    use * instead of @ to concatenate
>>    To read lines rather than words, pipe/redirect to a 'while read' loop
>>    Expressions don't expand in single quotes, use double quotes for that
>>    read without -r will mangle backslashes
>>
>>   scripts/arm-magic.sh                      | 12 ++---
>>   scripts/clean-package.sh                  | 10 ++--
>>   scripts/combined-ext-image.sh             | 14 +++---
>>   scripts/combined-image.sh                 |  4 +-
>>   scripts/config/lxdialog/check-lxdialog.sh | 20 ++++----
>>   scripts/deptest.sh                        | 24 ++++-----
>>   scripts/diffconfig.sh                     | 16 +++---
>>   scripts/ext-toolchain.sh                  | 81 ++++++++++++++++---------------
>>   scripts/flashing/flash.sh                 | 16 +++---
>>   scripts/freebsd.sh                        |  1 +
>>   scripts/gen-dependencies.sh               | 14 +++---
>>   scripts/get_source_date_epoch.sh          |  2 +-
>>   scripts/getver.sh                         | 12 ++---
>>   scripts/ipkg-make-index.sh                | 14 +++---
>>   scripts/make-ipkg-dir.sh                  |  4 +-
>>   scripts/mkits.sh                          |  8 +--
>>   scripts/om-fwupgradecfg-gen.sh            | 26 +++++-----
>>   scripts/patch-kernel.sh                   | 26 +++++-----
>>   scripts/patch-specs.sh                    |  2 +-
>>   scripts/relink-lib.sh                     |  4 +-
>>   scripts/rstrip.sh                         | 16 +++---
>>   scripts/strip-kmod.sh                     |  8 +--
>>   scripts/sysupgrade-tar.sh                 |  2 +-
>>   scripts/ubinize-image.sh                  | 20 ++++----
>>   24 files changed, 183 insertions(+), 173 deletions(-)
>>
>> --
>> 2.10.0
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev




More information about the Lede-dev mailing list