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.
This commit is contained in:
Maximilian Luz 2021-10-27 15:06:19 +02:00
parent 6c21326de8
commit f57e4e537e
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02

View file

@ -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..."