Re: Mangling shebangs in text files: How to detect them, bug in the current implementation and possible solutions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/23/21 2:11 AM, Miro Hrončok wrote:
> On 23. 09. 21 1:40, Josh Stone wrote:
>> On 9/22/21 4:21 AM, Miro Hrončok wrote:
>>> Hello,
>>>
>>> for many releases, Fedora has the brp-mangle-sehbangs BuildRoot Policy Script
>>> that does the following:
>>>
>>>    1) Gets all executable files in the buildroot
>>>    2) Gets all "text" files from those
>>>    3a) Mangles shebangs that are "wrong"
>>>        (e.g. #!/usr/bin/env node -> #!/usr/bin/node)
>>>    3b) Removes executable bits from "text" files without shebangs
>>
>> While we're at it, can we teach the script to ignore Rust attributes?
>> They're written like #![attr...], and when that's on the first line some
>> editors try to be helpful and make the file executable. That's
>> considered an error with the current script since the "shebang" doesn't
>> start with '/', but it would be best IMO to have it remove the
>> executable bit.
> 
> I believe that currently the script would error:
> 
> ERROR: $f has shebang which doesn't start with '/' (#![attr...])
> 
> Have you ever seen that in a Fedora package?

That's the error I meant, and yes I have seen that in real builds. I
have a line in the rust.spec %prep to "chmod -x *.rs", but I've also
seen this pop up in individual rust-* crate packaging.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux