From bd84ece1d42d00d48357ab31ca85a2f2f546fd84 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Wed, 13 Mar 2019 20:02:05 -0400 Subject: 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. --- libs/git | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libs') 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" -- cgit v1.2.3-70-g09d2