Bug 864303 - perl.prov does not parse package declarations that begin in first column of a file containing a Byte-Order-Mark (BOM)
perl.prov does not parse package declarations that begin in first column of a...
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
15
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Packaging Toolset Team
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-09 00:36 EDT by Gary Funck
Modified: 2016-02-10 09:43 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-26 04:31:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Gary Funck 2012-10-09 00:36:50 EDT
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 12:05:43 EDT
$ 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 03:58:29 EDT
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 06:33:32 EST
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.