Created attachment 362906 [details]
A file exposing this bug
Description of problem:
"file" reports Makefile.am as C++ program text.
Version-Release number of selected component (if applicable):
# file Coin-3.1.1/include/Inventor/draggers/Makefile.am
Coin-3.1.1/include/Inventor/draggers/Makefile.am: ASCII C++ program text
Always, on certain files.
Every text file with word "template" is C++ file. This is upstream decision, not a bug. Closing.
(In reply to comment #1)
> Every text file with word "template" is C++ file.
WHAT? Then I would recommend Fedora to abandon "file" from the distro.
> This is upstream decision, not a bug.
Then patch around this upstream decision. file has always been unreliable, but this disqualifies upstream "file" from being taken seriously.
Reopening - I consider your answer to be inappropriate you to be ignorant about bugs in the program you are trying to maintain.
Ralf, please reconsider. Given binary files with precisely defined header, file can algorithmically recognize their format. But for text files it has to use heuristics. Those heuristics have to be fairly simple, because file cannot afford to run very slowly. Recognizing text file formats with hairy grammar rules (such as Makefile or C++) requires either a complete parser of this grammar (too slow and elephantine for our purpose) or artificial intelligence (too unreliable). You cannot expect it to be 100% correct.
Of course something can be improved, where there is a good point there's something rotten: for example see Bug 526054 (you reported that, too), where LISP was recognized by string "(if", which can also appear in natural language text. But, the file program is no crystal ball nor wizard.
(In reply to comment #3)
> Ralf, please reconsider. Given binary files with precisely defined header, file
> can algorithmically recognize their format. But for text files it has to use
> heuristics. Those heuristics have to be fairly simple, because file cannot
> afford to run very slowly. Recognizing text file formats with hairy grammar
> rules (such as Makefile or C++) requires either a complete parser of this
> grammar (too slow and elephantine for our purpose) or artificial intelligence
> (too unreliable).
I disagree - It's a matter of point of view.
IMO "file" is outsmarting itself: It is being used for purposes it was never designed to be used for: text file/mime-type analysis.
> You cannot expect it to be 100% correct.
The least I can expect is it not to produce incorrect results.
Technically, speaking, "file" could provide specific results only for those cases it is "sure" about and fallback to "unknown" otherwise.
It could also be extended to check file extensions (I don't know if it already does).
> Of course something can be improved, where there is a good point there's
> something rotten: for example see Bug 526054 (you reported that, too),
Likely - I recall something like this.
Also, I have at least another case unreported: *.py scripts being reported as "java".
> LISP was recognized by string "(if", which can also appear in natural language
> text. But, the file program is no crystal ball nor wizard.
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '11'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 11's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 11 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.