Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2] support/scripts/check-merged: use getopts instead of getopt
Date: Sat, 22 Nov 2025 13:48:44 +0100	[thread overview]
Message-ID: <20251122134844.3f75931b@windsurf> (raw)
In-Reply-To: <20251121163453.499648-1-yann.morin.1998@free.fr>

Hello Yann,

On Fri, 21 Nov 2025 17:34:53 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Commit 1187c34d88e1 (support/scripts: move merged-usr errors message
> into check-merged-usr.sh) introduced the use of getopt to parse its
> options; doing so allowed to use long option (with two leading dashes),
> which is more descriptive than the usual one-character options.
> 
> However, getopt is part of util-linux; it is not a shell built-in.
> util-linux is not a prerequisite of Buildroot, so we may end up running
> on a system where it is missing.
> 
> We could add host-util-linux as a dependency when the system does not
> provide getopt, but that's not very nice; even though host-skeleton does
> not need to check for merged-bin for now, it does not need getopt, and
> thus we could add host-util-linux (which depends on host-skeleton) as a
> dependency of skeleton-custom. But that will not be tenable over the
> long run, especially if/when we do a merged-bin in host dir.
> 
> Requiring that util-linux be installed system-wide is not nice either;
> it's an additional requirement on the host.
> 
> We can do like we do in the oter scripts, though: use the shell built-in
> getopts. Its usage is slightly different, and does not support long
> options. As it's just for use in an intenral script, we can live with
> the less descriptive options, though.
> 
> Switch to using getopts, it removes the need for a new host dependency.
> 
> Fixes: 1187c34d88e16191753bfd0c3b4cd2f914813f31
> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Thanks a lot for the patch! I didn't review it as it was already
applied, but anyway the changes look fairly mechanism and
straightforward. Thanks for the quick reaction!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2025-11-22 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 16:34 [Buildroot] [PATCH v2] support/scripts/check-merged: use getopts instead of getopt Yann E. MORIN via buildroot
2025-11-22 12:31 ` Julien Olivain via buildroot
2025-11-22 12:48 ` Thomas Petazzoni via buildroot [this message]

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=20251122134844.3f75931b@windsurf \
    --to=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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