aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2019-03-27 22:06:38 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2019-03-27 22:22:22 -0400
commit2b351b2fc33cf6e5642fbd1f47984189374fe0e4 (patch)
tree53d1e6b4b58f881b0cf5d84c7adf2d7d4148ed03 /libs
parent19752b408d3d819343b9f31f12d17792fe91746c (diff)
downloadlibrebootfr-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')
-rwxr-xr-xlibs/git12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/git b/libs/git
index fa4434f7..a83f2246 100755
--- a/libs/git
+++ b/libs/git
@@ -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() {