applypatches.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # ./applypatches.sh /e/builds/beta-253/253-gitlab/comm-release/patches
  3. cd /e/builds/beta-253/comm-release/comm
  4. export IFS=
  5. # git checkout master
  6. # git checkout 2_53_9_1_final
  7. git checkout 2_53_10_beta_01
  8. while read -r line || [[ -n "$line" ]]; do
  9. echo "apply patch: $line"
  10. patchfile=$1/$(echo $line)
  11. if [ "$line" = "1602257-gitlab-253.patch" ] ||
  12. [ "$line" = "1602257-2-gitlab_V2-253.patch" ] ||
  13. [ "$line" = "1700003-domi_2_0_17_2-2538.patch" ] ||
  14. [[ "$line" == PPPP* ]] || [[ "$line" == WIP* ]] ||
  15. [[ "$line" == 9999999* ]] || [[ "$line" == 1551033-irc_* ]];
  16. then
  17. echo "patch $line skipped"
  18. else
  19. if [ -f "$patchfile" ]; then
  20. echo "$patchfile exist"
  21. # git apply --check "$patchfile"
  22. # git apply --index --whitespace=nowarn "$patchfile"
  23. # git apply --stat "$patchfile"
  24. git am --patch-format=hg --whitespace=nowarn < "$patchfile"
  25. if [ $? -eq 0 ]
  26. then
  27. echo "ok"
  28. else
  29. echo "error"
  30. git am --abort
  31. exit 1
  32. fi
  33. fi
  34. fi
  35. done < "$1"/series
  36. cd ..