Bug 1342507
| Summary: | starcal: starcal requires both Python 2 and Python 3 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Tomas Orsava <torsava> |
| Component: | starcal | Assignee: | Hedayat Vatankhah <hedayatv> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | hedayatv |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-06-04 21:00:35 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1285816, 1340802 | ||
|
Description
Tomas Orsava
2016-06-03 11:57:19 UTC
Thanks, fixed.
BTW, the shebang fix commands in the given link are incorrect and need a few changes to work correctly:
find -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python.*\)$=#!%{__python3}=' {} \;
Hi Hedayat!
Thank you very much for the heads up! The %{__python3} macro was a later addition, so I did not notice the clash with my favourite separator—the underscore. It should be fixed now!
The linu thus should be:
find -type f -executable -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)=#!%{__python3}=' {} +
Notice it's a bit different than the one you posted, because this one works also with e.g. the shebang `#!/usr/bin/python --some-flag`, which is important. Your sed line only allows for flags following `/usr/bin/env python` as you put the `.*` inside it's branch.
Thanks again for the bug report!
Hi & thank you for the description. However, there is a problem with your version too: it modifies the following shebangs too: /usr/bin/env python3 /usr/bin/python3 to /usr/bin/env python33 /usr/bin/python33 so you should exclude the cases where python is followed by 3! :) Ah, good point! How about this?
find -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +
That should work every time!
Yes, it looks great :) |