copy-firmware: Fix 'No such file or directory' error.

Attempting to clear the PARALLEL_ARGS_FILE variable when it was not
set would cause the above error message.  Clear it only when we know
we are using it.  This bug was only triggered when using the 'deb'
target, as it invokes the copy-firmware.sh script without any '-j'
argument, while the other install targets end up passing '-j1' when
not using parallel compression.

* copy-firmware.sh [NUM_JOBS > 1]: Only clear the content of
PARALLEL_ARGS_FILE when this condition is met.

Reported-by: Christophe Guillain <jean-christophe@guillain.net>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Maxim Cournoyer 2025-02-04 09:43:24 +09:00
parent 0fd450ee90
commit 51f770404a
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 1 additions and 1 deletions

View File

@ -111,9 +111,9 @@ grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g'
done done
if [ "$num_jobs" -gt 1 ]; then if [ "$num_jobs" -gt 1 ]; then
parallel -j"$num_jobs" -a "$parallel_args_file" parallel -j"$num_jobs" -a "$parallel_args_file"
echo > "$parallel_args_file" # prepare for next run
fi fi
echo > "$parallel_args_file"
# shellcheck disable=SC2162 # file/folder name can include escaped symbols # shellcheck disable=SC2162 # file/folder name can include escaped symbols
grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
directory="$destdir/$(dirname "$l")" directory="$destdir/$(dirname "$l")"