patch.sh 749 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. set -e
  3. shopt -s nullglob
  4. . "$GLUONDIR"/scripts/modules.sh
  5. TMPDIR="$GLUON_BUILDDIR"/tmp
  6. mkdir -p "$TMPDIR"
  7. PATCHDIR="$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
  19. git submodule update --init --recursive
  20. rm -rf "$PATCHDIR"
  21. done