Skip to content

Commit

Permalink
api: packages_file_required correct case where secondary OR package…
Browse files Browse the repository at this point in the history
… is already installed

if a secondary OR package is already installed and the first is not, list that as required instead of the first
  • Loading branch information
theofficialgman committed Mar 1, 2024
1 parent fa4da78 commit c7569b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,21 @@ packages_file_required() { #Returns which packages are required during installat
IFS='|'
local package
local available="no"
local installed="no"
#first check for any already installed packages
#if a package is already installed, it should be used even if it is not the first option in the OR
for package in $word ;do
if package_installed "$package" ;then
packages+="$package "
installed="yes"
break
fi
done
if [ "$installed" == "yes" ]; then
#a package in the OR is already installed
continue
fi
#then check for available packages
for package in $word ;do
if package_available "$package" ;then
packages+="$package "
Expand Down

0 comments on commit c7569b3

Please sign in to comment.