mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:24:58 +00:00
Ports: Build ports only once when running build_all.sh
Previously we'd end up building some ports multiple times, e.g. as a dependency for another port. This changes the build_all.sh script so that it builds ports only once.
This commit is contained in:
parent
8a95408673
commit
4115fcc933
2 changed files with 25 additions and 2 deletions
|
@ -346,6 +346,9 @@ do_uninstall() {
|
|||
echo "Uninstalling $port!"
|
||||
uninstall
|
||||
}
|
||||
do_showdepends() {
|
||||
echo -n $depends
|
||||
}
|
||||
do_all() {
|
||||
do_installdepends
|
||||
do_fetch
|
||||
|
@ -361,7 +364,7 @@ parse_arguments() {
|
|||
do_all
|
||||
else
|
||||
case "$1" in
|
||||
fetch|patch|configure|build|install|installdepends|clean|clean_dist|clean_all|uninstall)
|
||||
fetch|patch|configure|build|install|installdepends|clean|clean_dist|clean_all|uninstall|showdepends)
|
||||
do_$1
|
||||
;;
|
||||
--auto)
|
||||
|
@ -373,7 +376,7 @@ parse_arguments() {
|
|||
parse_arguments $@
|
||||
;;
|
||||
*)
|
||||
>&2 echo "I don't understand $1! Supported arguments: fetch, patch, configure, build, install, installdepends, clean, clean_dist, clean_all, uninstall."
|
||||
>&2 echo "I don't understand $1! Supported arguments: fetch, patch, configure, build, install, installdepends, clean, clean_dist, clean_all, uninstall, showdepends."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -26,11 +26,31 @@ case "$2" in
|
|||
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 "Already built $port as a dependency."
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue