'file -i' reports wrong MIME type for perl scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
file (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
This is on a (relatively) vanilla installation of Ubuntu Server 12.04 LTS 32-bit, with no modifications having been made to /etc/mime.types other than any changes that might have been performed by packages installed through synaptic. My installed version of the 'file' package is 5.09-2, which apt-get reports is the latest available one.
$ uname -a
Linux naisu 3.2.0-23-
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
Observe the following behaviour:
$ cat > mime.pl
#!/usr/bin/perl
use strict;
print "mime";
$ file -b mime.pl
a /usr/bin/perl script, ASCII text executable
$ file -b -i mime.pl
Expected output:
text/x-perl; charset=us-ascii
Actual output:
text/plain; charset=us-ascii
Oddly, when the -i flag is omitted, the 'file' utility correctly identifies the file as a Perl script, but as soon as it's added it seems to revert back to text/plain. Setting the +x flag on the file makes no difference. I've checked /etc/mime.types (even though it hasn't been modified by me directly), and the perl line is present:
$ cat /etc/mime.types | grep x-perl
text/x-perl pl pm
The same commands on a Debian Lenny 5.0.9 system yields the expected output:
$ file -b mime.pl
a /usr/bin/perl script text executable
$ file -b -i mime.pl
text/x-perl
description: | updated |
description: | updated |
affects: | ubuntu → file (Ubuntu) |
description: | updated |
Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https:/ /wiki.ubuntu. com/Bugs/ FindRightPackag e. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.
To change the source package that this bug is filed about visit https:/ /bugs.launchpad .net/ubuntu/ +bug/1008102/ +editstatus and add the package name in the text box next to the word Package.
[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]