https://bugs.documentfoundation.org/show_bug.cgi?id=105204
Bug ID: 105204
Summary: check shell scripts with shellcheck
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: libreoffice-bugs@lists.freedesktop.org
Reporter: j.nitschke+td...@ok.de
shellcheck is a static analyser for shell scripts which is available in most
linux distros.
I propose an easyhack to address the messages. This will fix many issues with
spaces in folders names, other corner cases and make the scripts more robust
overall.
who wants to work on this would have to install shellcheck
> sudo apt-get install shellcheck
run it on our shell scripts
> git grep -l -P '#!/.*((bash)|(sh))' | xargs shellcheck
or individually for each file e.g.
> shellcheck bin/distro-install-desktop-integration
output will look like this
> In bin/distro-install-desktop-integration line 131:
> cd $DESTDIR/$INSTALLDIR/share/xdg
> ^-- SC2164: Use cd ... || exit in case cd fails.
> ^-- SC2086: Double quote to prevent globbing and word splitting.
> ^-- SC2086: Double quote to prevent globbing and word splitting.
>
> In bin/distro-install-desktop-integration line 135:
> -e "s/\($INSTALLDIRNAME\)$PRODUCTVERSION/\1/" \
> ^-- SC2031: PRODUCTVERSION was modified in a
> subshell. That change might be lost.
>
> In bin/distro-install-desktop-integration line 136:
> -e "s/\($PRODUCTNAME\) $PRODUCTVERSION/\1/" \
> ^-- SC2031: PRODUCTVERSION was modified in a
> subshell. That change might be lost.
>
> In bin/distro-install-desktop-integration line 137:
> *.desktop
> ^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become
> options.
there are extensive explanations for each issue number
e.g. https://github.com/koalaman/shellcheck/wiki/SC2164
fix the warnings and commit a patches for each file on gerrit
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs