-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api:
read_packages_file
set output to null if not all required pack…
…ages are available
- Loading branch information
1 parent
3e3526c
commit 1eb8aa6
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1469,6 +1469,7 @@ app_type() { #there are 'standard' apps, and there are 'package' apps - an alias | |
} | ||
|
||
read_packages_file() { #Returns which packages are to be installed from a package-app - handle the '|' separater | ||
#if all packages are not available that are needed to be installed, returns no output | ||
local app="$1" | ||
[ -z "$app" ] && error "read_packages_file(): no app specified!" | ||
|
||
|
@@ -1485,16 +1486,27 @@ read_packages_file() { #Returns which packages are to be installed from a packag | |
if [[ "$word" == *'|'* ]];then | ||
IFS='|' | ||
local package | ||
local available="no" | ||
for package in $word ;do | ||
if package_available "$package" ;then | ||
packages+="$package " | ||
available="yes" | ||
break | ||
fi | ||
done | ||
if [ "$available" == "no" ]; then | ||
#no package in the OR is available so set the output as empty | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
theofficialgman
Author
Collaborator
|
||
packages='' | ||
break | ||
fi | ||
else | ||
if package_available "$word" ;then | ||
#no separator, so return it without change | ||
packages+="$word " | ||
else | ||
#one package in the AND is not available so set the output as empty | ||
packages='' | ||
break | ||
fi | ||
fi | ||
done | ||
|
does OR stand for something?