Bug 218979 - fix-shebang: add support for install-time fixes (not just patch-time)
Summary: fix-shebang: add support for install-time fixes (not just patch-time)
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D10554
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-30 20:58 UTC by John Hein
Modified: 2018-08-30 17:39 UTC (History)
3 users (show)

See Also:


Attachments
[patch] update shebangfix.mk to support stage-time fixes (2.33 KB, patch)
2017-04-30 20:58 UTC, John Hein
no flags Details | Diff
[patch] ports tree changes to be committe along with shebangfix.mk patch (1.82 KB, patch)
2017-05-04 16:45 UTC, John Hein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2017-04-30 20:58:55 UTC
Created attachment 182195 [details]
[patch] update shebangfix.mk to support stage-time fixes

With the recent more strict checking of shebang, it's more obvious that there are a number of ports where fixing shebangs at patch time is not sufficient.  One example is print/tex-xetex which installs files directly from a distribution tarball during the 'stage' phase.

Attached is an update to shebangfix.mk that supports fixing shebangs during the 'stage' phase.

The gating knob to control it is to define SHEBANG_FILES_INSTALL (relative to ${STAGEDIR}${PREFIX} by default) instead of (or in addition to) SHEBANG_FILES.

It also now supports SHEBANG_FILES_PATCH to be more explicit.  We could deprecate SHEBANG_FILES, but for now it can be a separate task to replace them.

I wasn't clear whether to name the new variables as *_INSTALL or *_STAGE.  Feedback welcome.  I opted for _INSTALL since it's generally recommended to use things like post-install rather than post-stage in ports Makefiles.

The premise for the update is pretty simple.  Use the same logic at patch time and stage time via .USE.  Operate over a different list of files and in a different directory (working directory vs. staging directory).
Comment 1 John Hein 2017-04-30 21:46:53 UTC
Add to reviews.freebsd.org
Comment 2 John Hein 2017-05-04 16:45:32 UTC
Created attachment 182303 [details]
[patch] ports tree changes to be committe along with shebangfix.mk patch

The shebangfix.mk patch (attachment 182195 [details]) renames fix-shebang to fix-shebang-patch (and adds fix-shebang-install).  Three ports are affected by the rename.  This patch updates those ports (and should be committed along with attachment 182195 [details]).
Comment 3 bye 2018-08-30 16:39:58 UTC
has anyone taken a look at this patch? I have similar issues with shebang fix that needs to be applied post-install.
Comment 4 Antoine Brodin freebsd_committer 2018-08-30 17:39:14 UTC
Fix the affected port individually.