diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-13 20:02:05 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-13 20:02:05 -0400 |
commit | bd84ece1d42d00d48357ab31ca85a2f2f546fd84 (patch) | |
tree | abf32d4a7f5d21d0bc4e24c40878eee71f8e8efa | |
parent | 925564a0653486f4076de06e2498bf75bb9f2f85 (diff) | |
download | librebootfr-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-x | libs/git | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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" |