From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Timur Tabi <ttabi@nvidia.com>
Cc: <jwboyer@kernel.org>, <superm1@gmail.com>, <linux-firmware@kernel.org>
Subject: Re: [PATCH 2/2] copy-firmware: fail gracefully if moreutils parallel is installed
Date: Tue, 18 Mar 2025 15:42:18 +0900 [thread overview]
Message-ID: <87h63qyh4l.fsf@gmail.com> (raw)
In-Reply-To: <20250317191606.64181-2-ttabi@nvidia.com> (Timur Tabi's message of "Mon, 17 Mar 2025 14:16:06 -0500")
Hi again,
Timur Tabi <ttabi@nvidia.com> writes:
[...]
> has_gnu_parallel() {
> if command -v parallel > /dev/null; then
> + # The moreutils package comes with a simpler version of "parallel"
> + # that does not support the --version or -a options. Check for
> + # that first. In some distros, installing the "parallel" package
> + # will replace the moreutils version with the GNU version.
> + parallel --version >/dev/null 2>&1
> + if [ $? -ne 0 ]; then
> + return 1
> + fi
I just rechecked; I don't think this currently work, it'd require
complicating the script to accommodate this less featureful parallel
variant, which is why I had opted to use GNU Parallel in the first place
:-).
If you inspect how parallel is used, it is passed a list of commands
from a file, which GNU parallel accepts via its '-a' option:
--8<---------------cut here---------------start------------->8---
parallel -j"$num_jobs" -a "$parallel_args_file"
--8<---------------cut here---------------end--------------->8---
Moreutils' parallel lacks the '-a' option, and doesn't appear to offer
something equivalent. So instead of simply adding appending your
command lines to a file, you'd have to build a space-separated list of
quoted commands... which makes quoting annoying and complicates
debugging (in the former case you can just inspect/execute the commands
file).
--
Thanks,
Maxim
next prev parent reply other threads:[~2025-03-18 6:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 19:16 [PATCH 1/2] copy-firmware: make script smarter about parameters Timur Tabi
2025-03-17 19:16 ` [PATCH 2/2] copy-firmware: fail gracefully if moreutils parallel is installed Timur Tabi
2025-03-18 6:20 ` Maxim Cournoyer
2025-03-18 7:06 ` Timur Tabi
2025-03-18 6:42 ` Maxim Cournoyer [this message]
2025-03-18 7:08 ` Timur Tabi
2025-03-18 14:58 ` Maxim Cournoyer
2025-03-18 15:14 ` Timur Tabi
2025-03-17 20:27 ` [PATCH 1/2] copy-firmware: make script smarter about parameters Mario Limonciello
2025-03-17 21:14 ` Timur Tabi
2025-03-17 21:16 ` Mario Limonciello
2025-03-17 21:45 ` Timur Tabi
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=87h63qyh4l.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=jwboyer@kernel.org \
--cc=linux-firmware@kernel.org \
--cc=superm1@gmail.com \
--cc=ttabi@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.