diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-27 22:06:38 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-27 22:22:22 -0400 |
commit | 2b351b2fc33cf6e5642fbd1f47984189374fe0e4 (patch) | |
tree | 53d1e6b4b58f881b0cf5d84c7adf2d7d4148ed03 /libs/git | |
parent | 19752b408d3d819343b9f31f12d17792fe91746c (diff) | |
download | librebootfr-2b351b2fc33cf6e5642fbd1f47984189374fe0e4.tar.gz librebootfr-2b351b2fc33cf6e5642fbd1f47984189374fe0e4.zip |
libs/git: Fail if patching fails
The recursive call in git_project_patch_recursive() is now performed
last so that if a patching attempt fails, the calling functions won't
attempt to apply more patches. The consequence of this change is that
patches are applied in (nearly) opposite order from before.
git_project_prepare_patch() is now called after
git_project_prepare_blobs() so that if patching fails and the user
chooses to perform additional project actions anyway, such as
building, the project is already deblobbed and not a risk to their
freedom. I had mistakenly reordered these function calls in a prior
commit.
Diffstat (limited to 'libs/git')
-rwxr-xr-x | libs/git | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -271,16 +271,16 @@ git_project_patch_recursive() { local patches_path=$project_path/$PATCHES/$path if ! [[ -d $project_path/$PATCHES ]]; then - return + return 0 fi + for patch in "$patches_path"/[!.]*.@(patch|diff); do + git_patch "$repository_path" "$branch" "$patch" || return 1 + done + if [[ $path != . ]]; then git_project_patch_recursive "$project" "$repository" "$branch" "$(dirname "$path")" fi - - for patch in "$patches_path"/[!.]*.@(patch|diff); do - git_patch "$repository_path" "$branch" "$patch" - done } git_project_clone() { @@ -316,8 +316,8 @@ git_project_prepare() { shift git_project_prepare_revision "$project" "$repository" "$@" - git_project_prepare_patch "$project" "$repository" "$@" git_project_prepare_blobs "$project" "$repository" "$@" + git_project_prepare_patch "$project" "$repository" "$@" } git_project_prepare_blobs() { |