From 9d8a941c679faa2818e238f8869e13e43b99fe54 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 18 Apr 2019 21:49:59 -0400 Subject: libs/project: Fail update check for git sources "update" actions were failing ever since revision b7fcc477 for projects with git sources due to an error in project_update_check_git() not returning 1 when it determined that the project's sources was a git repo (to force an update, always). --- libs/project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/project') diff --git a/libs/project b/libs/project index fb986f89..ea02293c 100755 --- a/libs/project +++ b/libs/project @@ -789,7 +789,7 @@ project_update_check_git() { requirements "git" - if ! git_project_check "$repository" + if git_project_check "$repository" then # Git repository should always be updated (even if upstream didn't progress). # For instance, this is useful for testing new versions of patches without changing revision. -- cgit v1.2.3-70-g09d2 From c2eabdd49e82bf7e86be034939a73b1b13db614f Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 18 Apr 2019 22:07:19 -0400 Subject: libs/project: Avoid subshell in 'if' statements The following will effectively disable any previous 'set -e': foo_fail() { ( set -e false true ) } if (set +e; foo_fail); then echo "foo_fail() failed, unsuccessfully" fi Creating a subshell within an 'if' statement makes 'set -e' non-functional. --- libs/project | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libs/project') diff --git a/libs/project b/libs/project index ea02293c..dfb745a0 100755 --- a/libs/project +++ b/libs/project @@ -149,7 +149,13 @@ project_action() { printf '%s\n\n' "Project $project $action (with ${arguments:-no argument})" - if (set +e; "$action" "$@"); then + ( + set +e + + "$action" "$@" + ) + + if [[ $? -eq 0 ]]; then printf '\n%s\n' "Project $project $action (with ${arguments:-no argument}) completed" else printf 1>&2 '\n%s\n' "Project $project $action (with ${arguments:-no argument}) failed" -- cgit v1.2.3-70-g09d2