aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2019-10-19 17:32:48 -0500
committerAndrew Robbins <contact@andrewrobbins.info>2019-10-19 17:32:48 -0500
commit436971aa5a2cd6ba3662ee29b83f06424bc466ce (patch)
tree181bec5d8bc9770781bf73950abefe27eb52574e /libs
parent250e8b28511a789a96eec2055219f04495fd45f5 (diff)
downloadlibrebootfr-436971aa5a2cd6ba3662ee29b83f06424bc466ce.tar.gz
librebootfr-436971aa5a2cd6ba3662ee29b83f06424bc466ce.zip
libs/project: Simplify acting on dependencies
Diffstat (limited to 'libs')
-rwxr-xr-xlibs/project28
1 files changed, 8 insertions, 20 deletions
diff --git a/libs/project b/libs/project
index cfb886ed..adc738fb 100755
--- a/libs/project
+++ b/libs/project
@@ -149,15 +149,11 @@ project_dependencies_check() {
local project=$1
shift
- local -a dependencies
- mapfile -t dependencies < <(project_dependencies "$project" "$@")
-
+ local dependency
local -i missing=0
- for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do
- local -a dependency=(${dependencies[i]})
-
- project_check "${dependency[0]}" || let ++missing
+ project_dependencies "$project" "$@" | while read -r dependency; do
+ project_check $dependency || let ++missing
done
return $missing
@@ -167,16 +163,11 @@ project_dependencies_sources_check() {
local project=$1
shift
- local -a dependencies
- mapfile -t dependencies < <(project_dependencies "$project" "$@")
-
+ local dependency
local -i missing=0
- for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do
- local -a dependency=(${dependencies[i]})
-
- project_sources_directory_filled_check "${dependency[0]}" ||
- let ++missing
+ project_dependencies "$project" "$@" | while read -r dependency; do
+ project_sources_directory_filled_check $dependency || let ++missing
done
return $missing
@@ -187,12 +178,9 @@ project_dependencies_action_arguments() {
local project=$2
shift 2
- local -a dependencies
- mapfile -t dependencies < <(project_dependencies "$project" "$@")
-
- for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do
- local -a dependency=(${dependencies[i]})
+ local -a dependency
+ project_dependencies "$project" "$@" | while read -ra dependency; do
if project_function_check "${dependency[0]}" "$action"; then
project_action_arguments "$action" "${dependency[@]}"
fi