Bug 13475

Summary: New post-processing in rpm: strip perl version from shebang
Product: Mageia Reporter: Jerome Quelin <jquelin>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Normal    
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: rpm-mageia-setup, spec-helper CVE:
Status comment:

Description Jerome Quelin 2014-06-03 11:02:31 CEST
Some perl packages are installing scripts in /usr/bin, with a shebang line so that kernel knows how to interpret them.

Sometimes, the installed shebang is including the perl version, such as:

    #!/usr/bin/perl5.18.2

I propose that we add a new post-processing step in rpm to strip such perl version from the shebang line, to get back to:

    #!/usr/bin/perl

This would prevent the rebuilding of perl modules shipping scripts with wrong shebangs when updating perl.

It could be as simple as:
for f in $(ls $buildroot/usr/bin/*); do
  perl -pi -E '$.==1 && s{^(#!/usr/bin/perl).*$}{$1}' $f
done

thanks.

Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2014-06-03 15:08:38 CEST
Why not fix perl packages instead?
I've fixed some perl module once that introduced it.
I don't remember which one but that should be easy to find out (beginning with perl-Module/Build*)
Thierry Vignaud 2014-06-03 15:09:35 CEST

Source RPM: rpm => rpm-mageia-setup

Samuel Verschelde 2015-05-19 19:06:38 CEST

Severity: normal => enhancement

Thierry Vignaud 2016-01-06 10:24:05 CET

Source RPM: rpm-mageia-setup => rpm-mageia-setup, spec-helper