From: Joachim Wiberg <troglobit@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 3/3] package/ssdp-responder: fix warnings from check-package and shellcheck
Date: Tue, 01 Nov 2022 08:30:58 +0100 [thread overview]
Message-ID: <871qqnf7wt.fsf@gmail.com> (raw)
In-Reply-To: <20221031214956.37e0ef12@windsurf>
Hi Thomas!
On Mon, Oct 31, 2022 at 21:49, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> On Mon, 31 Oct 2022 18:46:32 +0100
> Joachim Wiberg <troglobit@gmail.com> wrote:
>> +cmd()
>> +{
>> + start-stop-daemon -q -p "$PIDFILE" -x "$DAEMON" "$@"
>> + status=$?
>> + [ $status -eq 0 ] && echo "OK" || echo "FAIL"
>> +
>> + return $status
>> +}
> I don't think we're using this cmd construct anywhere else in the tree,
> or did I miss some change in our coding style/policy?
I mentioned it in the cover letter, but that information should have
been here in this patch. Sorry about that.
It all started out with utils/check-package telling me I used $DAEMON
wrong. While changing that I ended up with a final comment from it
that said I should also "run shellcheck and fix the warnings".
It in turn had several grievances which I took one by one. In this one
I used the same construct as in package/smcroute/S41smcroute to work
around a warning about using `$?` instead of using an `if cmd; then ...`
>> start() {
>> - printf 'Starting %s: ' "$NAME"
>> - start-stop-daemon -S -q -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
>> - [ $? = 0 ] && echo "OK" || echo "FAIL"
>
> This all looked matching our coding style. Why are you changing this?
>> case "$1" in
>> - start|stop|restart)
>> - "$1"
>> - ;;
>> - reload)
>> - restart
>> - ;;
>> - *)
>> - echo "Usage: $0 {start|stop|restart|reload}"
>> - exit 1
>> + start|stop|restart)
>> + "$1"
>> + ;;
>> + reload)
>> + restart
>> + ;;
>> + *)
>> + echo "Usage: $0 {start|stop|restart|reload}"
>> + exit 1
>
> I'm not sure what is the recommended indentation style in our init
> scripts. Tabs? Spaces?
Shellcheck pointed out this section had four spaces indent instead of
the eight (tab) used for the rest of the script. Iirc from the "own
code coding style" discussions C and shell script should follow the
same style, but I may very well be wrong here.
Best regards
/Joachim
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-11-01 7:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 17:46 [Buildroot] [PATCH 0/3] package/ssdp-responder bump and check-package fixes Joachim Wiberg
2022-10-31 17:46 ` [Buildroot] [PATCH 1/3] package/ssdp-responder: bump to version 1.9 Joachim Wiberg
2022-10-31 20:47 ` Thomas Petazzoni via buildroot
2022-11-01 7:18 ` Joachim Wiberg
2022-11-02 17:06 ` Thomas Petazzoni via buildroot
2022-11-02 21:19 ` Yann E. MORIN
2022-11-02 21:21 ` Thomas Petazzoni via buildroot
2022-11-02 22:08 ` Joachim Wiberg
2022-11-05 18:45 ` Yann E. MORIN
2022-11-05 18:48 ` Yann E. MORIN
2022-11-06 8:47 ` Joachim Wiberg
2022-10-31 17:46 ` [Buildroot] [PATCH 2/3] package/ssdp-responder: minor update of help text Joachim Wiberg
2022-11-05 18:47 ` Yann E. MORIN
2022-10-31 17:46 ` [Buildroot] [PATCH 3/3] package/ssdp-responder: fix warnings from check-package and shellcheck Joachim Wiberg
2022-10-31 20:49 ` Thomas Petazzoni via buildroot
2022-11-01 7:30 ` Joachim Wiberg [this message]
2022-11-05 18:44 ` Yann E. MORIN
2022-11-06 8:54 ` Joachim Wiberg
2022-11-06 18:19 ` [Buildroot] [PATCH v2 1/1] " Joachim Wiberg
2022-11-22 21:39 ` Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qqnf7wt.fsf@gmail.com \
--to=troglobit@gmail.com \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox