diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-10-19 17:32:48 -0500 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-10-19 17:32:48 -0500 |
commit | 436971aa5a2cd6ba3662ee29b83f06424bc466ce (patch) | |
tree | 181bec5d8bc9770781bf73950abefe27eb52574e /libs | |
parent | 250e8b28511a789a96eec2055219f04495fd45f5 (diff) | |
download | librebootfr-436971aa5a2cd6ba3662ee29b83f06424bc466ce.tar.gz librebootfr-436971aa5a2cd6ba3662ee29b83f06424bc466ce.zip |
libs/project: Simplify acting on dependencies
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/project | 28 |
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 |