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
$ rpm -qf --qf="%{SOURCERPM}\n" /usr/lib/rpm/perl.prov rpm-4.9.1.3-7.fc17.src.rpm
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.
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.