Bug 262358

Summary: Uses/shebangfix.mk runs before distribution patching (PATCH_SITES)
Product: Ports & Packages Reporter: Charlie Li <vishwin>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Some People CC: ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258112

Description Charlie Li freebsd_committer freebsd_triage 2022-03-05 14:21:45 UTC
In my original patch for bug 258112, a file gets processed with USES=shebangfix properly, but the same file also has a PATCH_SITES/PATCHFILES that obliterates the shebangfix (changes the shebang from python to python3). The .orig shows the shebangfix applied. This probably needs to run during post-patch or similar.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2022-03-05 19:12:57 UTC
You can use TARGET_ORDER_OVERRIDE for this.
Comment 2 Charlie Li freebsd_committer freebsd_triage 2022-03-05 19:25:39 UTC
Sure, if I understand the default target order with 210:fix-shebang, which is before even 300:pre-patch. Is there any particular reason to have fix-shebang in this order by default? Upstream commits/patches that we need to pull in lieu of new releases can and will change shebangs (ie to signify only one version family of an interpreter) and they should be accounted for after do-patch.
Comment 3 Charlie Li freebsd_committer freebsd_triage 2022-03-05 19:37:25 UTC
A quick search of TARGET_ORDER_OVERRIDE reveals nine uses, three of which concern fix-shebang. All fix-shebang cases override the default order to run after do-patch.