Bug 526056 - "file" reports Makefile.am as "ASCII C++ program text"
Summary: "file" reports Makefile.am as "ASCII C++ program text"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-28 15:03 UTC by Ralf Corsepius
Modified: 2010-06-28 14:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-28 14:49:56 UTC


Attachments (Terms of Use)
A file exposing this bug (2.51 KB, text/plain)
2009-09-28 15:03 UTC, Ralf Corsepius
no flags Details

Description Ralf Corsepius 2009-09-28 15:03:46 UTC
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-5.03-2.fc11.x86_64
and
file-5.03-2.fc11.i586


# file Coin-3.1.1/include/Inventor/draggers/Makefile.am
Coin-3.1.1/include/Inventor/draggers/Makefile.am: ASCII C++ program text

How reproducible:
Always, on certain files.

Actual results:
c.f. above

Expected results:
Function.

Comment 1 Jan Görig 2010-01-13 11:35:57 UTC
Every text file with word "template" is C++ file. This is upstream decision, not a bug. Closing.

Comment 2 Ralf Corsepius 2010-01-13 11:58:59 UTC
(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.

> Closing.    
Reopening - I consider your answer to be inappropriate you to be ignorant about bugs in the program you are trying to maintain.

Comment 3 Daniel Novotny 2010-01-13 12:18:03 UTC
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.

Comment 4 Ralf Corsepius 2010-01-13 15:38:28 UTC
(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".

> 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.

Comment 5 Bug Zapper 2010-04-28 10:35:55 UTC
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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Fedora Admin XMLRPC Client 2010-05-20 12:23:09 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora Admin XMLRPC Client 2010-05-20 12:27:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Fedora Admin XMLRPC Client 2010-06-10 10:46:02 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Bug Zapper 2010-06-28 14:49:56 UTC
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.


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