Ports: Allow verbose argument in build_all.sh

This patch allows for a verbose argument to be passed
so that the build output of the individual builds
is printed to stdout instead of /dev/null to help with diagnosing errors

If the verbose argument is not passed the old behaviour is preserved
and the build output is printed to /dev/null
This commit is contained in:
Tom Needham 2021-03-14 12:14:22 +00:00 committed by Andreas Kling
parent 3c35ea30cc
commit 26d72d3048
Notes: sideshowbarker 2024-07-18 21:20:49 +09:00

View file

@ -1,10 +1,26 @@
#!/usr/bin/env bash
clean=false
verbose=false
case "$1" in
clean)
clean=true
;;
verbose)
verbose=true
;;
*)
;;
esac
case "$2" in
clean)
clean=true
;;
verbose)
verbose=true
;;
*)
;;
esac
@ -16,13 +32,26 @@ for file in *; do
pushd $file > /dev/null
dirname=$(basename $file)
if [ "$clean" == true ]; then
./package.sh clean_all > /dev/null 2>&1
if [ "$verbose" == true ]; then
./package.sh clean_all
else
./package.sh clean_all > /dev/null 2>&1
fi
fi
if $(./package.sh > /dev/null 2>&1 ); then
echo "Built ${dirname}."
if [ "$verbose" == true ]; then
if $(./package.sh); then
echo "Built ${dirname}."
else
echo "ERROR: Build of ${dirname} was not successful!"
some_failed=true
fi
else
echo "ERROR: Build of ${dirname} was not successful!"
some_failed=true
if $(./package.sh > /dev/null 2>&1); then
echo "Built ${dirname}."
else
echo "ERROR: Build of ${dirname} was not successful!"
some_failed=true
fi
fi
popd > /dev/null
fi