Advertisement
Guest User

Untitled

a guest
Aug 27th, 2021
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -e
  4.  
  5. patches="$(readlink -f -- $1)"
  6.  
  7. shopt -s nullglob
  8. for project in $(cd $patches; echo *);do
  9. p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
  10. [ "$p" == build ] && p=build/make
  11. pushd $p
  12. git clean -fdx; git reset --hard
  13. for patch in $patches/$project/*.patch;do
  14. if git apply --check $patch;then
  15. git am $patch
  16. elif patch -f -p1 --dry-run < $patch > /dev/null;then
  17. #This will fail
  18. git am $patch || true
  19. patch -f -p1 < $patch
  20. git add -u
  21. git am --continue
  22. else
  23. echo "Failed applying $patch"
  24. fi
  25. done
  26. popd
  27. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement