aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorScott B2021-09-16 17:56:37 -0700
committerAntoine Viallon2021-10-25 10:18:32 +0200
commita3c149ea5fbd9b190d093ae05a282fbf119aab11 (patch)
tree295875439c5e90675e77e2c25c5761fdb6184520 /PKGBUILD
parent499f7a307d7da92163a26350d283033016a81ce3 (diff)
downloadaur-a3c149ea5fbd9b190d093ae05a282fbf119aab11.tar.gz
PKGBUILD: better handle point release patches
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD33
1 files changed, 20 insertions, 13 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a75ef0676a32..88c0a3f9d499 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -203,26 +203,33 @@ export KBUILD_BUILD_TIMESTAMP=${KBUILD_BUILD_TIMESTAMP:-$(date -Ru${SOURCE_DATE_
prepare() {
cd "linux-${_major}"
- # Apply Xanmod patch
- msg2 "Applying Xanmod patch..."
- patch -Np1 -i "../patch-${xanmod}"
+ # WARN: mangle Makefile versions here if needed to apply patches cleanly
- # WARN: mangle Makefile versions here if needed so patches apply cleanly
-
- ## Monkey patch: apply kernel.org patches when mainline is slightly ahead of Xanmod official
- patch -Np1 -i ../patch-5.14.4-5
-
- # Archlinux patches
+ # Apply patches
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
- [[ "$src" =~ .*(patch|diff)$ ]] || continue
- msg2 "Applying patch $src..."
- patch -Np1 < "../$src"
+ case "$src" in
+ patch-${_major}*xanmod*xz)
+ # Apply Xanmod patch
+ msg2 "Applying Xanmod patch..."
+ patch -Np1 -i "../${src%\.xz}"
+ ;;
+ patch-${_major}*xz)
+ # Apply kernel.org point releases if we're building ahead of Xanmod official
+ msg2 "Applying kernel.org point release ${src%\.xz} ..."
+ patch -Np1 -i "../${src%\.xz}"
+ ;;
+ *patch|*diff)
+ # Apply any other patches
+ msg2 "Applying patch $src..."
+ patch -Np1 < "../$src"
+ ;;
+ esac
done
- # WARN: mangle Makefile versions if needed before calling setlocalversion
+ # WARN: mangle Makefile versions here if needed before calling setlocalversion
msg2 "Setting version..."
scripts/setlocalversion --save-scmversion