Bug 1279401 - Regression between 5.22 and 5.25: a perl script is mislabeled as module source
Summary: Regression between 5.22 and 5.25: a perl script is mislabeled as module source
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-09 11:34 UTC by Petr Pisar
Modified: 2015-11-26 11:21 UTC (History)
3 users (show)

Fixed In Version: file-5.25-3.fc24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 16:40:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
The 40_draw.pl sample (3.26 KB, text/plain)
2015-11-09 11:35 UTC, Petr Pisar
no flags Details

Description Petr Pisar 2015-11-09 11:34:45 UTC
perl-Padre-0.90 delivers 40_draw.pl file in the documentation:

$ head share/examples/wx/40_draw.pl 
#!/usr/bin/perl 
use strict;
use warnings;


#############################################################################
## Name:        lib/Wx/DemoModules/wxPrinting.pm
## Based on the Printing demo by Mattia Barbon distribured in the Wx::Demo
## Copyright:   (c) 2001, 2003, 2005-2006 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or


The old good behavior:

[test@fedora-24 Padre-0.90]$ rpm -qf /usr/bin/file
file-5.22-4.fc23.x86_64
[test@fedora-24 Padre-0.90]$ /usr/bin/file share/examples/wx/40_draw.pl
share/examples/wx/40_draw.pl: Perl script, ASCII text executable

The new bad behavior.

[test@fedora-24 Padre-0.90]$ rpm -qf /usr/bin/file
file-5.25-1.fc24.x86_64
[test@fedora-24 Padre-0.90]$ /usr/bin/file share/examples/wx/40_draw.pl 
share/examples/wx/40_draw.pl: Perl5 module source, ASCII text

The files contains both shell bang line and both "package" keyword. But I believe than any file with shell bang line should be recognized as "Perl script".

Comment 1 Petr Pisar 2015-11-09 11:35:59 UTC
Created attachment 1091693 [details]
The 40_draw.pl sample

Comment 2 Petr Pisar 2015-11-18 19:47:43 UTC
See <https://ppisar.fedorapeople.org/perl_rebuild/scratch/2015-11-18/index.xhtml#done> for Perl mass rebuild. It breaks generating Perl RPM dependencies on many RPM packages. For example, perl-App-find2perl is very simple package with the only Perl file /usr/bin/find2perl.

Comment 3 Jitka Plesnikova 2015-11-19 16:08:21 UTC
I tried to solve the issue for Perl in attribute file perl.attr which is part of perl-generators. It helped, but it did not solve it completely. 

All perl(*) dependencies are back, but shebang command '/usr/bin/perl' is still missing.

It seems shebang is added by rpm only, if the file is detected as script.

For example:

The latest koji build
$ rpm -qpR perl-App-find2perl-1.003-6.fc23.noarch.rpm 
/usr/bin/perl
perl(:MODULE_COMPAT_5.22.0)
perl(Config)
perl(File::Spec::Functions)
perl(strict)
perl(vars)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Package build with updated perl-generators (not submitted yet)
$ rpm -qpR perl-App-find2perl-1.003-7.fc24.noarch.rpm 
perl(:MODULE_COMPAT_5.22.0)
perl(Config)
perl(File::Spec::Functions)
perl(strict)
perl(vars)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Comment 4 Petr Pisar 2015-11-23 16:40:07 UTC
I confirm file-5.25-3.fc24 fixes the regression.

Comment 5 Petr Pisar 2015-11-26 11:21:07 UTC
I checked all perlish packages built with the broken file packages in the Koji (53) and the only affected package was postgrey, so I rebuild it.


Note You need to log in before you can comment on or make changes to this bug.