mirror of
https://gitlab.com/kernel-firmware/linux-firmware.git
synced 2025-12-10 07:44:48 +01:00
copy-firmware: fail gracefully if moreutils parallel is installed
The copy-firmware.sh script can use the "parallel" command to parallelize some operations, but it needs the GNU version of parallel. There is another, simpler version of parallel that is part of the moreutils package, but that version confuses the has_gnu_parallel() function. So first test to make sure that the --version parameter is even recognized before trying to use it. If in the future, moreutils parallel adds support for --version, this script should still work because that version should never report "GNU parallel". Signed-off-by: Timur Tabi <ttabi@nvidia.com>
This commit is contained in:
parent
6a94efbe2a
commit
1d704ac5f1
1 changed files with 8 additions and 0 deletions
|
|
@ -22,6 +22,14 @@ warn() {
|
|||
|
||||
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
|
||||
if parallel --version | grep -Fqi 'gnu parallel'; then
|
||||
return 0
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue