patch.sh 437 B

123456789101112131415161718192021
  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 [ -z "$1"/patches/$module/*.patch ]; then continue; fi
  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. git -C "$dir" checkout -B patched
  16. git -C "$dir" branch -d patching
  17. done