aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2019-03-13 20:02:05 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2019-03-13 20:02:05 -0400
commitbd84ece1d42d00d48357ab31ca85a2f2f546fd84 (patch)
treeabf32d4a7f5d21d0bc4e24c40878eee71f8e8efa
parent925564a0653486f4076de06e2498bf75bb9f2f85 (diff)
downloadlibrebootfr-bd84ece1d42d00d48357ab31ca85a2f2f546fd84.tar.gz
librebootfr-bd84ece1d42d00d48357ab31ca85a2f2f546fd84.zip
libs/git: Actually patch recursively
Previously the only way patching would work is if for every target there existed a corresponding directory under $project/$PATCHES, e.g: "./libreboot update coreboot x200 8MiB corebootfb grub" would require the "grub" directory and its parents: "projects/coreboot/patches/x200/8MiB/corebootfb/grub" Now you only need target-specific patch directories if you need them; I believe this was the intended behavior. Superfluous quotes were removed for readability.
-rwxr-xr-xlibs/git20
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/git b/libs/git
index 48499921..5f48005d 100755
--- a/libs/git
+++ b/libs/git
@@ -228,25 +228,25 @@ git_project_check() {
}
git_project_patch_recursive() {
- local project="$1"
- local repository="$2"
- local branch="$3"
- local path="${4:-.}"
+ local project=$1
+ local repository=$2
+ local branch=$3
+ local path=$4
- local repository_path="$(git_project_repository_path "$repository")"
- local project_path="$(project_path "$project")"
- local patches_path="$project_path/$PATCHES/$path"
+ local repository_path=$(git_project_repository_path "$repository")
+ local project_path=$(project_path "$project")
+ local patches_path=$project_path/$PATCHES/$path
- if ! [[ -d "$patches_path" ]]; then
+ if ! [[ -d $project_path/$PATCHES ]]; then
return
fi
- if [[ "$path" != "." ]]; then
+ if [[ $path != . ]]; then
git_project_patch_recursive "$project" "$repository" "$branch" "$(dirname "$path")"
fi
for patch in "$patches_path"/[!.]*.@(patch|diff); do
- if [[ "${patch##*.}" == "patch" ]]; then
+ if [[ ${patch##*.} == patch ]]; then
git_patch "$repository_path" "$branch" "$patch"
else
diff_patch_file "$repository_path" "$patch"