Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- build_root=$(pwd) # vendorsetup.sh is sourced by build/envsetup.sh in root of android build tree. Hope that nobody can correctly source it not from root of android tree.
- echo "Applying patches"
- patches_path="$build_root/device/jsr/d10f/patches/"
- pushd "$patches_path" > /dev/null
- unset repos
- find -type f -name '*.patch'|cut -d / -f 2-|sort
- for patch in `find -type f -name '*.patch'|cut -d / -f 2-|sort`; do
- # Strip patch title to get git commit title - git ignore [text] prefixes in beginning of patch title during git am
- title=$(sed -rn "s/Subject: (\[[^]]+] *)*//p" "$patch")
- absolute_patch_path="$patches_path/$patch"
- # Supported both path/to/repo_with_underlines/file.patch and path_to_repo+with+underlines/file.patch (both leads to path/to/repo_with_underlines)
- repo_to_patch="$(if dirname $patch|grep -q /; then dirname $patch; else dirname $patch |tr '_' '/'|tr '+' '_'; fi)"
- echo -n "Is $repo_to_patch patched for '$title' ?.. "
- pushd "$build_root/$repo_to_patch" > /dev/null
- if (git log |fgrep -q "$title" ); then
- echo Yes
- else
- echo No
- echo "Trying to apply patch $(basename "$patch") to '$repo_to_patch'"
- if ! git am $absolute_patch_path; then
- echo "Failed, aborting git am"
- git am --abort
- fi
- fi
- popd > /dev/null
- done
- popd > /dev/null
- echo "Applying patches: done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement