patch.sh 837 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. set -e
  3. shopt -s nullglob
  4. . scripts/modules.sh
  5. mkdir -p "$GLUON_TMPDIR"
  6. GLUONDIR="$(pwd)"
  7. PATCHDIR="$GLUON_TMPDIR"/patching
  8. trap 'rm -rf "$PATCHDIR"' EXIT
  9. for module in $GLUON_MODULES; do
  10. echo "--- Patching module '$module' ---"
  11. git clone -s -b base --single-branch "$GLUONDIR/$module" "$PATCHDIR" 2>/dev/null
  12. cd "$PATCHDIR"
  13. for patch in "$GLUONDIR/patches/$module"/*.patch; do
  14. git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' -c commit.gpgsign=false am --whitespace=nowarn --committer-date-is-author-date "$patch"
  15. done
  16. cd "$GLUONDIR/$module"
  17. git fetch "$PATCHDIR" 2>/dev/null
  18. git checkout -B patched FETCH_HEAD >/dev/null
  19. git config branch.patched.remote .
  20. git config branch.patched.merge refs/heads/base
  21. git submodule update --init --recursive
  22. rm -rf "$PATCHDIR"
  23. done