Commit bb2e512
committed
fix(pkgbuild): distro-specific functions must not be overwritten by base
When a PKGBUILD declares both 'prepare()' (priority 0, base) and
'prepare__ubuntu_jammy()' (priority 3, distro-specific), AddItem was
overwriting the higher-priority function with the base one whenever
the base directive was parsed after the distro variant — because
mapFunctions ran unconditionally even though the priority gate
already short-circuited variables/arrays for that case.
This broke distro-specific hooks any time the base function appeared
later in the file (the common pattern in PKGBUILDs that share a
helper '_prepare' and have one distro override calling it). The
symptom on Ubuntu jammy was the chrono-hours patch being silently
skipped because the jammy-specific prepare was clobbered by the
generic one.
Gate mapFunctions on priority >= oldPriority so distro/codename
variants survive a subsequent base assignment. Arrays still
accumulate (intentional, matches makepkg's source_<arch> behaviour);
this only changes function dispatch.1 parent 8b7b370 commit bb2e512
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
0 commit comments