2021-01-22 16:44:05 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-02-04 00:04:45 +00:00
|
|
|
|
|
|
|
clean=false
|
2021-03-14 12:14:22 +00:00
|
|
|
verbose=false
|
|
|
|
|
2020-02-04 00:04:45 +00:00
|
|
|
case "$1" in
|
|
|
|
clean)
|
|
|
|
clean=true
|
|
|
|
;;
|
2021-03-14 12:14:22 +00:00
|
|
|
verbose)
|
|
|
|
verbose=true
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$2" in
|
|
|
|
clean)
|
|
|
|
clean=true
|
|
|
|
;;
|
|
|
|
verbose)
|
|
|
|
verbose=true
|
|
|
|
;;
|
2020-02-04 00:04:45 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
some_failed=false
|
2021-04-21 20:53:02 +00:00
|
|
|
built_ports=""
|
2020-02-04 00:04:45 +00:00
|
|
|
|
|
|
|
for file in *; do
|
|
|
|
if [ -d $file ]; then
|
|
|
|
pushd $file > /dev/null
|
2021-04-21 20:50:59 +00:00
|
|
|
port=$(basename $file)
|
2021-04-21 20:53:02 +00:00
|
|
|
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
|
2021-04-23 09:11:26 +00:00
|
|
|
echo "Built $port."
|
2021-04-21 20:53:02 +00:00
|
|
|
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
|
|
|
|
|
2020-02-04 00:04:45 +00:00
|
|
|
if [ "$clean" == true ]; then
|
2021-03-14 12:14:22 +00:00
|
|
|
if [ "$verbose" == true ]; then
|
|
|
|
./package.sh clean_all
|
|
|
|
else
|
|
|
|
./package.sh clean_all > /dev/null 2>&1
|
|
|
|
fi
|
2020-02-04 00:04:45 +00:00
|
|
|
fi
|
2021-03-14 12:14:22 +00:00
|
|
|
if [ "$verbose" == true ]; then
|
2021-03-14 14:27:17 +00:00
|
|
|
if ./package.sh; then
|
2021-04-21 20:50:59 +00:00
|
|
|
echo "Built ${port}."
|
2021-03-14 12:14:22 +00:00
|
|
|
else
|
2021-04-21 20:50:59 +00:00
|
|
|
echo "ERROR: Build of ${port} was not successful!"
|
2021-03-14 12:14:22 +00:00
|
|
|
some_failed=true
|
2021-11-06 00:06:56 +00:00
|
|
|
popd > /dev/null
|
|
|
|
continue
|
2021-03-14 12:14:22 +00:00
|
|
|
fi
|
2020-02-04 00:04:45 +00:00
|
|
|
else
|
2021-03-14 14:27:17 +00:00
|
|
|
if ./package.sh > /dev/null 2>&1; then
|
2021-04-21 20:50:59 +00:00
|
|
|
echo "Built ${port}."
|
2021-03-14 12:14:22 +00:00
|
|
|
else
|
2021-04-21 20:50:59 +00:00
|
|
|
echo "ERROR: Build of ${port} was not successful!"
|
2021-03-14 12:14:22 +00:00
|
|
|
some_failed=true
|
2021-11-06 00:06:56 +00:00
|
|
|
popd > /dev/null
|
|
|
|
continue
|
2021-03-14 12:14:22 +00:00
|
|
|
fi
|
2020-02-04 00:04:45 +00:00
|
|
|
fi
|
2021-11-06 00:06:56 +00:00
|
|
|
|
|
|
|
built_ports="$built_ports $port $(./package.sh showproperty depends) "
|
2020-02-04 00:04:45 +00:00
|
|
|
popd > /dev/null
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$some_failed" == false ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
2021-01-03 13:47:42 +00:00
|
|
|
fi
|