Browse Source

pkg/arch: Use git to apply commits

Applying patches with 'patch' creates problems when renaming files and
changing them later in a different change in the the same patch file,
causing patch to complain that the file does not exist. So use 'git am'
instead.
Maximilian Luz 3 years ago
parent
commit
f57e4e537e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      pkg/arch/kernel/PKGBUILD

+ 5 - 1
pkg/arch/kernel/PKGBUILD

@@ -77,13 +77,17 @@ prepare() {
   echo "-$pkgrel" > localversion.10-pkgrel
   echo "${pkgbase#linux}" > localversion.20-pkgname
 
+  # setup git
+  git config --global user.email "surfacebot@users.noreply.github.com"
+  git config --global user.name "surfacebot"
+
   local src
   for src in "${source[@]}"; do
     src="${src%%::*}"
     src="${src##*/}"
     [[ $src = *.patch ]] || continue
     echo "Applying patch $src..."
-    patch -Np1 < "../$src"
+    git am -3 "../$src"
   done
 
   echo "Setting config..."