Skip to content

Commit

Permalink
Ports: Install all dependencies instead of just one
Browse files Browse the repository at this point in the history
Commit 9b7e217 broke installation of port dependencies by
`return`ing as soon as the first dependency was found.
  • Loading branch information
gmta authored and awesomekling committed Feb 2, 2023
1 parent 62f4486 commit 403c0e6
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Ports/.port_include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,21 @@ package_install_state() {
}
installdepends() {
for depend in "${depends[@]}"; do
if [ -z "$(package_install_state $depend)" ]; then
# Split colon seperated string into a list
IFS=':' read -ra port_directories <<< "$SERENITY_PORT_DIRS"
for port_dir in "${port_directories[@]}"; do
if [ -d "${port_dir}/$depend" ]; then
(cd "${port_dir}/$depend" && ./package.sh --auto)
return
fi
done

>&2 echo "Error: Dependency $depend could not be found."
exit 1
if [ -n "$(package_install_state $depend)" ]; then
continue
fi

# Split colon separated string into a list
IFS=':' read -ra port_directories <<< "$SERENITY_PORT_DIRS"
for port_dir in "${port_directories[@]}"; do
if [ -d "${port_dir}/$depend" ]; then
(cd "${port_dir}/$depend" && ./package.sh --auto)
continue 2
fi
done

>&2 echo "Error: Dependency $depend could not be found."
exit 1
done
}
uninstall() {
Expand Down

0 comments on commit 403c0e6

Please sign in to comment.