Skip to content

Commit

Permalink
Restore some of --strict to BuildPackages script
Browse files Browse the repository at this point in the history
#4384

The addition of the --parallel option to the bin/BuildPackages.sh
script unfortunately broke the operation of the --strict option.

This restores the functionality of --strict when --parallel is not used.

I am not 1337 enough to work out how to do catch the error codes
of parallel background processes!
  • Loading branch information
wilfwilson committed Apr 11, 2021
1 parent ded93f2 commit 8f260c9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/BuildPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ build_one_package() {
date >> "$LOGDIR/fail.log"
for PKG in "${PACKAGES[@]}"
do
(
( # start a background process
# cut off the ending slash (if exists)
PKG="${PKG%/}"
# cut off everything before the first slash to only keep the package name
Expand Down Expand Up @@ -307,6 +307,7 @@ do
warning "$PKG does not seem to be a package directory, skipping"
fi
) &
BUILD_PID=$!
if [ "x$PARALLEL" = "xyes" ]; then
# If more than 4 background jobs are running, wait for one to finish (if
# <wait -n> is available) or for all to finish (if only <wait> is available)
Expand All @@ -315,7 +316,10 @@ do
fi
else
# wait for this package to finish building
wait
if ! wait $BUILD_PID && [[ $STRICT = yes ]]
then
exit 1
fi
fi;
done
# Wait until all packages are built, if in parallel
Expand Down

0 comments on commit 8f260c9

Please sign in to comment.