Commit 5bd7160
kpatch-build: fix Fedora 42+ kernel source directory nesting
Starting with Fedora 42, the kernel SRPM unpacks with an extra level
of nesting:
BUILD/kernel-6.14.0-build/kernel-6.14/linux-6.14.0-63.fc42.x86_64/
The existing glob BUILD/kernel-*/linux-* only matches one level deep
and fails on this layout.
Use nullglob with a bash array to safely count flat-glob matches:
- Exactly one match: move it (traditional RHEL/CentOS/Fedora < 42).
- Multiple matches: die with a clear diagnostic.
- Zero matches: search one level deeper with find -maxdepth 3, again
requiring exactly one result before proceeding.
All mv calls preserve the original "2>&1 | logger || die" error
handling, and ambiguous matches are always fatal.
Tested on Fedora 42 with kernel 6.14.0-63.fc42.x86_64.
Signed-off-by: Or Shoval <oshoval@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 7552b46 commit 5bd7160
1 file changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1086 | 1107 | | |
1087 | 1108 | | |
1088 | 1109 | | |
| |||
0 commit comments