-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change shebangs with Tools/scripts/pathfix.py? #24
Comments
I think we should package this properly – into |
Is the file name limit a bug or a feature? I'd fix it before we recommend it. |
@torsava, I think adding a CLI option to act on all files (or all executable files?) would have a good chance of being accepted ustream. |
So, do we want to act on all files with the extension I'm more inclined towards the first. |
On further thought, for Fedora the tool might be OK as it is. Files in (Also, setuptools gives correct shebangs anyway – this is only for other buildsystems.) |
So we advise to do |
That of course was my intention as well. |
I'll craft a pull-request for |
I went with |
@hroncok I'm kinda reluctant requiring python3-devel in buildroot just to change shebang.. |
Well since this was originally opened for Python only (unlike rpm-software-management/rpm#344), it wasn't a problem for me. Feel free to go with Shell instead. |
We gonna need this anyway to get rid of |
So to sum up: |
Problem I see is that you are trying to solve python-specific way while
problem is much more global. And answering Miro's question, RPM brp can do
python stuff too.
|
Can the global solution can change (Apologies if this was answered before. If it was, the answer wasn't explicit enough for me.) |
Additionally, that change should only be done for Python 2, not with Python 3. I don't think a global tool should be customizable (=complicated) enough for that... |
Why not? There is implemented generic mechanism of changing shebangs. And brp stands for |
To separate the two intertwined issues currently under discussion: 1. "recommend that in the shebang sections of this guide"I don't think 2. "use it automagically in rpm builds to fix shebangs? (with similar logic to pybytecompile script)"Here |
I'm afraid this is rawhide only anyway. |
You're right, that even strengthens the argument for the macro. |
This is now in all Fedoras and in EPEL7. |
There is a script in
/usr/lib64/python3.6/Tools/scripts/pathfix.py
that changes shebangs. We may want to:I'm opening this here, because of the first above point. If we say we want to use this automatically, we can discuss this in some ML.
Example usage:
Note: A small problem with this script is that it only converts files where the name matches
r'^[a-zA-Z0-9_]+\.py$'
when called on directory, but you can call it directly on files.The text was updated successfully, but these errors were encountered: