Skip to content

%python3_fix_shebang doesn't fix shebang if python is not installed #180

@MeggyCal

Description

@MeggyCal

Hi, %python3_fix_shebang and its younger brother have proven to be really useful, thanks.

If python is present, the macro behaves as intended:

[   12s] ++ realpath /usr/bin/python3
[   12s] + sed -i '1s@#\!.*python\S*@#\!/usr/bin/python3.11@' ...

But if no python is present (because the package doesn't need it for build), then the macro changes nothing:

[   12s] ++ realpath /usr/bin/python3
[   12s] + sed -i '1s@#\!.*python\S*@#\!/usr/bin/python3@' ...

I discovered it while playing with yast2-multipath, which is one of the packages which just provide a single python file which is not run during the build and install.

What to do? If I add BuildRequires: python3-base, then it works, but it doesn't feel right to me, because python is actually not needed during the build. Maybe we could try to guess the primary python flavor for the current distro in the sed script? Edit: no, that would break all the multi-flavor "regular" python packages, where this macro is implicitly used as well.

What would you suggest?

Anyway, thank you very much for taking care of the macros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions