Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433579 - sys-apps/file-5.11 - `file --version' returns a 1 error status code
Summary: sys-apps/file-5.11 - `file --version' returns a 1 error status code
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL: http://bugs.gw.com/view.php?id=198
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-31 22:22 UTC by Matthew Schultz
Modified: 2012-09-06 22:32 UTC (History)
0 users

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


Attachments
file-version-status-code.patch (file-version-status-code.patch,415 bytes, patch)
2012-08-31 23:00 UTC, Matthew Schultz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schultz 2012-08-31 22:22:13 UTC
file improperly returns a status code of 1 after executing file --version.  This notes that the command errored even though it was a successful execution and should have returned 0.



Reproducible: Always

Steps to Reproduce:
1. A simple bash script:

#!/bin/bash
file --version
echo $?

2. Output:

file-5.11
magic file from /usr/share/misc/magic
1
Actual Results:  
returns status code of 1

Expected Results:  
return status code of 0
Comment 1 Matthew Schultz 2012-08-31 22:34:35 UTC
In addition, the man page indicates that the return code should be 0 on success and makes no exception for file --version.
Comment 2 Matthew Schultz 2012-08-31 23:00:45 UTC
Created attachment 322675 [details, diff]
file-version-status-code.patch

Modifies file so it returns a status code of 0 as it should when successfully executing and showing the current version of file installed with the command: file --version.  This patch should be applied to all versions of file currently in portage.  I'm not sure how to notify upstream so someone might want to do that so it gets fixed there as well.
Comment 3 SpanKY gentoo-dev 2012-09-04 19:10:43 UTC
upstream has a bugzilla to submit fixes to directly ...

http://bugs.gw.com/
Comment 4 Matthew Schultz 2012-09-04 19:28:40 UTC
(In reply to comment #3)
> upstream has a bugzilla to submit fixes to directly ...
> 
> http://bugs.gw.com/

I wasn't aware that they did.  I just figured it was magic that they knew about anything since the homepage just points to an ftp site.
Comment 5 SpanKY gentoo-dev 2012-09-04 20:25:23 UTC
(In reply to comment #4)

yeah, visibility into the file processes is pretty bad
Comment 6 Matthew Schultz 2012-09-06 12:32:55 UTC
(In reply to comment #5)
> (In reply to comment #4)
> 
> yeah, visibility into the file processes is pretty bad

Adding some information about where to report bugs and who are the upstream maintainers in the metadata.xml might help.
Comment 7 Matthew Schultz 2012-09-06 14:36:43 UTC
I filed a bug with upstream and it has just been patched so I suppose we should see this fix in the next version: http://bugs.gw.com/view.php?id=198
Comment 9 Matthew Schultz 2012-09-06 20:01:40 UTC
(In reply to comment #8)
> good idea
> 
> http://sources.gentoo.org/sys-apps/file/metadata.xml?r1=1.3&r2=1.4

I don't see any change in metadata at that link.  Has it just not been committed yet?
Comment 10 SpanKY gentoo-dev 2012-09-06 21:22:44 UTC
you're too fast.  the web cvs syncs periodically with the real tree.
Comment 11 Matthew Schultz 2012-09-06 22:32:33 UTC
(In reply to comment #10)
> you're too fast.  the web cvs syncs periodically with the real tree.

ah ok, I didn't realize there was a delay. :-)