patch.sh 431 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -e
  3. shopt -s nullglob
  4. . "$1"/modules
  5. for module in $GLUON_MODULES; do
  6. dir="$1"/$module
  7. git -C $dir checkout -B patching base
  8. if [ "$1"/patches/$module/*.patch ]; then
  9. git -C "$dir" am "$1"/patches/$module/*.patch || (
  10. git -C "$dir" am --abort
  11. git -C "$dir" checkout patched
  12. git -C "$dir" branch -D patching
  13. false
  14. )
  15. fi
  16. git -C "$dir" checkout -B patched
  17. git -C "$dir" branch -d patching
  18. done