ladybird/Ports/build_all.sh
Gunnar Beutner 3a3f47115d Ports: Shorten the build message for skipped builds
The new message for skipping builds makes it hard to
distinguish failed builds from builds that were just skipped
so change it back to the old one - but don't actually build
packages twice again.
2021-04-23 11:33:03 +02:00

84 lines
1.9 KiB
Bash
Executable file

#!/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
some_failed=false
built_ports=""
for file in *; do
if [ -d $file ]; then
pushd $file > /dev/null
port=$(basename $file)
port_built=0
for built_port in $built_ports; do
if [ "$built_port" = "$port" ]; then
port_built=1
break
fi
done
if [ $port_built -eq 1 ]; then
echo "Built $port."
popd > /dev/null
continue
fi
if ! [ -f package.sh ]; then
echo "ERROR: Skipping $port because its package.sh script is missing."
popd > /dev/null
continue
fi
built_ports="$built_ports $port $(./package.sh showdepends) "
if [ "$clean" == true ]; then
if [ "$verbose" == true ]; then
./package.sh clean_all
else
./package.sh clean_all > /dev/null 2>&1
fi
fi
if [ "$verbose" == true ]; then
if ./package.sh; then
echo "Built ${port}."
else
echo "ERROR: Build of ${port} was not successful!"
some_failed=true
fi
else
if ./package.sh > /dev/null 2>&1; then
echo "Built ${port}."
else
echo "ERROR: Build of ${port} was not successful!"
some_failed=true
fi
fi
popd > /dev/null
fi
done
if [ "$some_failed" == false ]; then
exit 0
else
exit 1
fi