Page MenuHomeFreeBSD

Support multiple values in *_OLD_CMD for shebangfix.mk
ClosedPublic

Authored by AMDmi3 on Oct 1 2015, 10:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 12 2024, 4:03 AM
Unknown Object (File)
Jan 28 2024, 12:51 AM
Unknown Object (File)
Jan 19 2024, 12:16 PM
Unknown Object (File)
Jan 11 2024, 3:26 AM
Unknown Object (File)
Jan 7 2024, 9:59 AM
Unknown Object (File)
Dec 31 2023, 5:06 AM
Unknown Object (File)
Dec 22 2023, 10:33 AM
Unknown Object (File)
Dec 20 2023, 1:42 AM
Subscribers

Details

Reviewers
bapt
Group Reviewers
portmgr
Commits
rP399684: Improve shebangfix framework
Summary

Allow multiple values in *_OLD_CMD

  • For many interpreters, there are multiple common shebang patterns (e.g. /usr/bin/perl, /bin/perl, /usr/bin/env perl for perl), each of which require fixing. With this change it's possible to add them all to shebangfix.mk instead of adding *_OLD_CMD to many ports
  • Even a single port may use different shebangs for a single interpreter, now it's possible to use shebangfix on them all (possibly with defining custom *_OLD_CMD), while before you had to fix some shebangs with ${REINPLACE_CMD}

While here, add some indentation to shebangfix.mk

Test Plan
  • Tested in poudriere 9.3, 10.2 on custom port which needs multiple shebang fixes

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

AMDmi3 retitled this revision from to Support multiple values in *_OLD_CMD for shebangfix.mk.
AMDmi3 updated this object.
AMDmi3 edited the test plan for this revision. (Show Details)

I believe this breaks some existing ports that set foo_OLD_CMD

Also, one can already use foo_OLD_CMD= a regular expression

AMDmi3 edited the test plan for this revision. (Show Details)
AMDmi3 edited edge metadata.

I believe this breaks some existing ports that set foo_OLD_CMD

Probably you're right, but only ones using space in the variable. I'll check for these

Also, one can already use foo_OLD_CMD= a regular expression

You can still use a regexp.

Maybe all the foo_OLD_CMD?= should be changed to foo_OLD_CMD+= to add the stock OLD_CMDs after the ones added by the ports.

In D3756#77565, @mat wrote:

Maybe all the foo_OLD_CMD?= should be changed to foo_OLD_CMD+= to add the stock OLD_CMDs after the ones added by the ports.

Sounds right, in progress.

  • Change shebangfix.mk to append patterns to user defined ones as suggested by mat@
  • Fixed shebangfix.mk so it only replace complete words, not an any substring. This fixes cases like /usr/bin/perl5 which is fixed to /usr/local/bin/perl5 (and for some reason not caught by stage-qa)
  • Quoted all occurences of *_OLD_CMD with space in the three
  • Removed redundant *_OLD_CMD which are now provided by shabangfix.mk
  • Fixed all direct usages of ${*_OLD_CMD}
  • Fixed all *_OLD_CMD which referenced other variables (such as ${SETENV}), while they should be static
AMDmi3 edited edge metadata.
  • Revert unrelated change which somehow crept in
mat added inline comments.
databases/skytools/Makefile
15 ↗(On Diff #9010)

I think this is wrong, it has USES=python, so python_CMD is ${PYTHON_CMD}, which is LOCALBASE/bin/python2.7 or something.

deskutils/tnote/Makefile
19 ↗(On Diff #9010)

This too.

devel/cvs2svn/Makefile
26–28 ↗(On Diff #9010)

the python2 bits can be removed, because USES=python.

devel/googlemock/Makefile
27 ↗(On Diff #9010)

remove

devel/googletest/Makefile
23 ↗(On Diff #9010)

remove

devel/lua-alien/Makefile
24–26 ↗(On Diff #9010)

Maybe this should be added to shebangfix.mk, @bapt ?

emulators/dynagen/Makefile
29–30 ↗(On Diff #9010)

The python_env one can be removed, it is taken care of now.

emulators/pipelight/Makefile
43 ↗(On Diff #9010)

this should be added to shebangfix.mk

games/childsplay/Makefile
24 ↗(On Diff #9010)

remove, because USES=python

graphics/inkscape/Makefile
33–35 ↗(On Diff #9010)

It feels like inkscape is missing USES=python

graphics/py-cairo/Makefile
23 ↗(On Diff #9010)

drop, USES=python

graphics/py3-cairo/Makefile
21 ↗(On Diff #9010)

drop, USES=python

lang/python-tools/Makefile
43 ↗(On Diff #9010)

drop, USES=python

mail/bsfilter/Makefile
21 ↗(On Diff #9010)

could be added to shebangfix.mk

net/polyorb/Makefile
35 ↗(On Diff #9010)

one empty line should go.

AMDmi3 marked 10 inline comments as done.Oct 2 2015, 9:33 PM
AMDmi3 added inline comments.
devel/googlemock/Makefile
27 ↗(On Diff #9010)

This ports is broken WRT python and its usage, I'm dealing with this problem separately:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203514

If this review gets committed before the PR, I'd like to leave it as-is to preserve status quo and not introduce extra diff.

devel/googletest/Makefile
23 ↗(On Diff #9010)

Same as with googlemock

devel/lua-alien/Makefile
24–26 ↗(On Diff #9010)

Yes, but it would depend on USES=lua. We'll also have to add a check mechanism into shebangfix.mk.

emulators/dynagen/Makefile
29–30 ↗(On Diff #9010)

This port also breaks because of too clever ​python_bol_CMD and ​python_cnf_CMD, so it depends on

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203515

AMDmi3 edited edge metadata.

Fixes suggested by mat (except for googletest, googlemock and lua)

AMDmi3 edited edge metadata.

More fixes

devel/lua-alien/Makefile
24–26 ↗(On Diff #9075)

Sure, I have no problem about it being between .if ${USES:Mlua*}, or something.

AMDmi3 added inline comments.
AMDmi3 edited edge metadata.
  • Add lua support
  • Remove no-op SHEBANG_LANG lines (e.g. SHEBANG_LANG=perl has no sense, as perl is appended by shebangfix.mk anyway)
bapt added a reviewer: bapt.
This revision is now accepted and ready to land.Oct 14 2015, 7:08 PM
This revision was automatically updated to reflect the committed changes.