Skip to content

Commit e81b950

Browse files
fix(scripts): skip stable-point-release patches already in tree
Liquorix zen patches are named v{KVER}-lqx{N}.patch where KVER is the stable point release they target. XanMod already tracks that stable version, so the patch is a no-op and conflicts everywhere. Detect this case by comparing the patch filename version against the tree version and skip rather than fail.
1 parent 5e9b2fc commit e81b950

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

scripts/apply-patches.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,25 @@ apply_series() {
6666
fi
6767

6868
# --forward skips hunks already present in the tree (exit 0).
69-
# Only fail on genuine conflicts (exit 1 with rejects).
69+
# If the patch encodes a stable-point-release version (e.g. v6.19.10-lqx2.patch)
70+
# that the tree already satisfies, skip it rather than failing.
71+
local patch_name
72+
patch_name=$(basename "${patch_path}")
73+
local patch_kver=""
74+
if [[ "${patch_name}" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)- ]]; then
75+
patch_kver="${BASH_REMATCH[1]}"
76+
fi
77+
78+
if [[ -n "${patch_kver}" ]]; then
79+
local tree_kver
80+
tree_kver=$(make -s -C "${KERNEL_SRC}" kernelversion 2>/dev/null | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
81+
if [[ "${patch_kver}" == "${tree_kver}" ]]; then
82+
log WARN "patch targets ${patch_kver} which matches tree version — skipping: ${line}"
83+
(( skipped++ )) || true
84+
continue
85+
fi
86+
fi
87+
7088
if ! patch -p1 --forward -d "${KERNEL_SRC}" < "${patch_path}" 2>/dev/null; then
7189
# Check whether any .rej files were created (genuine conflict)
7290
if find "${KERNEL_SRC}" -name '*.rej' -newer "${patch_path}" | grep -q .; then

0 commit comments

Comments
 (0)