Bug 864303 - perl.prov does not parse package declarations that begin in first column of a file containing a Byte-Order-Mark (BOM)
Summary: perl.prov does not parse package declarations that begin in first column of a...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Packaging Toolset Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-09 04:36 UTC by Gary Funck
Modified: 2016-02-10 14:43 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-01-26 09:31:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Perl package module file with BOM (31 bytes, application/octet-stream)
2012-10-09 04:36 UTC, Gary Funck
no flags Details

Description Gary Funck 2012-10-09 04:36:50 UTC
Created attachment 623912 [details]
Perl package module file with BOM

Description of problem:

/usr/lib/rpm/perl.prov does not detect a package declaration if that declarations begins in the first character position of a file, when the file begins with a Byte-Order-Mark (BOM).

If the source file is modified in a trivial way, such as adding an initial blank line, then perl.prov will parse the package declaration correctly.


Steps to Reproduce:

$ alias perl.prov=/usr/lib/rpm/perl.prov
$ cat -n perl-pkg-with-bom.pm
     1  package Package::With::BOM;
$ perl.prov perl-pkg-with-bom.pm
# No output
$ cat -n perl-pkg-with-bom-and-initial-newline.pm 
     1   
     2  package Package::With::BOM;
$ perl.prov perl-pkg-with-bom-and-initial-newline.pm       
perl(Package::With::BOM)

$ file perl-pkg-with-bom*
perl-pkg-with-bom-and-initial-newline.pm: UTF-8 Unicode (with BOM) text
perl-pkg-with-bom.pm:                     Perl5 module source, UTF-8 Unicode (with BOM) text

Comment 1 Ville Skyttä 2012-10-09 16:05:43 UTC
$ rpm -qf --qf="%{SOURCERPM}\n" /usr/lib/rpm/perl.prov
rpm-4.9.1.3-7.fc17.src.rpm

Comment 2 Panu Matilainen 2012-10-12 07:58:29 UTC
In my not very humble opinion, UTF-8 with a BOM is a disease that's best cured by amputation... remove the BOM, problem gone. Otherwise we'll be "fixing" script after script after script until the end of the world. Issuing a warning when UTF-8 BOM is detected by libmagic is likely the best thing rpm could do here.

Comment 3 Jan Kurik 2015-12-22 11:33:32 UTC
This bug is currently assigned to an unsupported release. If you think this bug is still valid and should remain open, please re-assign it to a supported release (F22, F23) or to rawhide.

Bugs which will be assigned to an unsupported release are going to be closed as EOL (End Of Life) on January 26th, 2016.


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