From f88f58898eb2f0fcc914ce8cc60097cb12d0bd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= <seblu@seblu.net> Date: Wed, 3 Jun 2020 12:10:53 +0200 Subject: [PATCH] Improve patching step --- PKGBUILD | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 52e253c..f7b12dd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -24,12 +24,15 @@ prepare() { cd linux - # apply patches - for _f in "${source[@]}"; do - if [[ "$_f" =~ \.patch$ ]]; then - msg2 "Patching $_f" - patch -p1 < "$srcdir/$_f" - fi + + # apply patch from the source array (should be a pacman feature) + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + [[ $src = *.patch ]] || continue + msg2 "Applying patch $src..." + patch -Np1 < "../$src" done # loading default config -- GitLab