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(-) 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(-) 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 From 1c5677e98e25aa2eaa2f545d851678c05127445d Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 18 Apr 2019 22:31:51 -0400 Subject: projects/grub/grub: Stop build() on error This way we can be sure we're not attempting to build when instead we should be bailing out (i.e. when the project's sources are not available). --- projects/grub/grub | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/projects/grub/grub b/projects/grub/grub index 8bc7cd43..3daca888 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -79,25 +79,28 @@ build() { local build_path="$(project_build_path "$project" "$@")" local raw_keymap_path="$project_path/$CONFIGS/keymaps" - mkdir -p "$build_path" + ( + set -e - grub_build_utils + mkdir -p "$build_path" - if [[ "$target" == 'bios' ]]; then - grub_build_floppy_image - else - grub_build_standalone_image - fi + grub_build_utils - for raw_keymap in "$raw_keymap_path"/*; do - grub_build_layout "$raw_keymap" - done + if [[ "$target" == 'bios' ]]; then + grub_build_floppy_image + else + grub_build_standalone_image + fi - grub_build_font + for raw_keymap in "$raw_keymap_path"/*; do + grub_build_layout "$raw_keymap" + done - grub_copy_modules + grub_build_font + grub_copy_modules - make -C "$sources_path" distclean + make -C "$sources_path" distclean + ) } build_check() { -- cgit v1.2.3-70-g09d2