Skip to content

Conversation

@classabbyamp
Copy link
Member

Ghidra's embedded jython contains scripts with shebangs like #!/usr/bin/env python. These seem to be designed to be run by jython, not the system python, and as such, they should not have their shebangs changed to #!/usr/bin/python2. This adds support for disabling that hook in cases like this.

Testing the changes

  • I tested the changes in this PR: YES

useful if there are special python-containing shebangs that should not
be rewritten, for example with Ghidra's embedded jython.
Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good idea. We have several packages that ship example scripts that would probably be better left unmodified. During the next big Python bump, I'll try to remember to identify those and we can eliminate them from future update cycles.

@classabbyamp
Copy link
Member Author

classabbyamp commented Apr 18, 2024

example scripts that would probably be better left unmodified

maybe it would make sense to have this as a separate variable for patterns to ignore?

python_shebang_ignore="/usr/libexec/ghidra/Ghidra/Features/Python/data/jython-2.7.3/*"

for example

edit: with the current hook, I'm not sure I see a way to do this without massively increasing the time spent running the hook.

@fanyx
Copy link
Contributor

fanyx commented Apr 18, 2024

maybe it would make sense to have this as a separate variable for patterns to ignore?

python_shebang_ignore="/usr/libexec/ghidra/Ghidra/Features/Python/data/jython-2.7.3/*"

this solution feels very clean

@classabbyamp
Copy link
Member Author

maybe, but it would require checking every path against (multiple) globs, from what i can tell, which could be slow

@classabbyamp classabbyamp merged commit bf16ab2 into void-linux:master Apr 24, 2024
@classabbyamp classabbyamp deleted the py-ver-ignore branch April 24, 2024 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

xbps-src xbps-src related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants