Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270235 - sys-apps/file-5.03 --exclude text or -e text fails (contrary to man page)
Summary: sys-apps/file-5.03 --exclude text or -e text fails (contrary to man page)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-17 22:39 UTC by ferret
Modified: 2011-06-06 23:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
file(1) man page (converted to plain text) (file.1.txt,17.41 KB, text/plain)
2009-05-19 03:48 UTC, ferret
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ferret 2009-05-17 22:39:39 UTC
The man page in sys-apps/file-5.03 says that -e text or --exclude text should work, but in practice that gives a usage error.

I do not know which is wrong, the man page or the file program.

Thanks.
Comment 1 Sebastian Luther (few) 2009-05-18 07:06:04 UTC
There is no such option in the man page. Sure you read the man page coming from the package?
Comment 2 ferret 2009-05-18 20:25:34 UTC
It's there.  I even looked in the source tarball file-5.03.tar.gz.  It is definitely in the man page.
Comment 3 Sebastian Luther (few) 2009-05-18 20:45:50 UTC
Sorry, the translations are outdated. Could you please give some examples?
Comment 4 ferret 2009-05-19 03:48:10 UTC
Created attachment 191741 [details]
file(1) man page (converted to plain text)

Here is the file(1) man page that is installed by file-5.03 on my system.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-05-19 20:58:17 UTC
At least I couldn't find anything in file's ChangeLog about the removal of -e/--exclude option...
Comment 6 SpanKY gentoo-dev 2009-05-19 23:15:57 UTC
post actual commands and test files.  seems to work fine for me:

$ file --version
file-5.03
magic file from /usr/share/misc/magic

$ echo 'main(){}' > test.c

$ file test.c
test.c: ASCII text

$ file -e ascii test.c
test.c: data
Comment 7 ferret 2009-05-20 01:31:31 UTC
You have in fact demonstrated another part of the problem.

Sorry, the report is unclear.  When I say '-e text' I mean literally, '-e text'.  The word 'text'.

$ file -e ascii test.c
test.c: data

$ file -e text test.c
Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...
       file -C -m magicfiles
Try `file --help' for more information.

In the man page '-e ascii' is not documented as a valid test, whereas '-e text' is.
Comment 8 ferret 2009-05-20 01:32:58 UTC
From the man page (attached to this bug report):

     -e, --exclude testname
             Exclude the test named in testname from the list of tests made to
             determine the file type. Valid test names are:

             apptype
                EMX application type (only on EMX).

             text
                Various types of text files (this test will try to guess the
                text encoding, irrespective of the setting of the ‘encoding’
                option).

             encoding
                Different text encodings for soft magic tests.

             tokens
                Looks for known tokens inside text files.

             cdf
                Prints details of Compound Document Files.

             compress
                Checks for, and looks inside, compressed files.

             elf
                Prints ELF file details.

             soft
                Consults magic files.

             tar
                Examines tar files.

Note no mention of an 'ascii' testname
Comment 9 SpanKY gentoo-dev 2009-05-20 02:20:31 UTC
nothing says "text" is a valid test, so i dont see any bug here
Comment 10 ferret 2009-05-20 03:15:58 UTC
What?  Are we looking at the same text here?  Did you actually read any of what I've said?  The man page said -e is followed by one of several test names.  It then says (I quote): "Valid test names are:", followed by a list of the test names.  Here is that list:

apptype text encoding tokens cdf compress elf soft tar

Here for you I shall try each one of those in turn.  Can you spot the odd one out?


$ file -e apptype test.c 
test.c: ASCII text

$ file -e text test.c 
Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...
       file -C -m magicfiles
Try `file --help' for more information.

$ file -e encoding test.c 
test.c: ASCII text

$ file -e tokens test.c 
test.c: ASCII text

$ file -e cdf test.c 
test.c: ASCII text

$ file -e compress test.c 
test.c: ASCII text

$ file -e elf test.c 
test.c: ASCII text

$ file -e soft test.c 
test.c: ASCII text

$ file -e tar test.c 
test.c: ASCII text

$
Comment 11 SpanKY gentoo-dev 2010-01-25 02:53:34 UTC
seems the bug didnt exist in older man pages and for some reason, on my system, the old man page was staying cached in /var/cache/man/ and it wasnt actually showing me a newer one
Comment 12 Evert 2010-10-09 01:28:13 UTC
I contacted the author for 3 gentoo bugs about sys-apps/file-5.0{3,4}, and he says this bug is fixed on head.