#8474: Detect whether a program is in the path
-----------------------------+----------------------------------------------
Reporter: jhpalmieri | Owner: drkirkby
Type: defect | Status: positive_review
Priority: blocker | Milestone: sage-4.3.4
Component: porting | Keywords:
Author: John Palmieri | Upstream: N/A
Reviewer: David Kirkby | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by drkirkby):
* status: needs_review => positive_review
* reviewer: => David Kirkby
Comment:
OK, I think I understand this better now.
I just noticed the example above where I showed 'which' behaving as
expected was actually on !OpenSolaris x64 (hostname hawk). However, I just
tried it on Solaris 10 (SPARC), and get the same behavior. i.e. my script
works as expected.
I just tried what Mike did, using 'which ffddfdfd' on Solaris 10 (SPARC),
Solaris 10 x64 (virtual machine) and !OpenSolaris (x64). What I found was
* 'which' has an exit code of 0 on Solaris 10 (SPARC).
* 'which' has an exit code of 0 on Solaris 10 x86 (virtual machine).
* 'which' an exit code of 1 on !OpenSolaris.
However, the man pages on !OpenSolaris and Solaris 10 are different. The
Solaris 10 man page does not discuss exit codes, but the !OpenSolaris man
page does. (This is one of the problems of using non-POSIX functions -
their behavior is not well defined).
I installed the patch and run the tests. All thse doctests then pass -
there are still some other failures.
I'm not a Python guru, but the patch all looks logical to me. So I'm going
to give it positive review.
One very minor niggle - you might want to change the example in the
docstring. I think
{{{
sage: have_program('ls')
True
sage: have_program('there_is_not_a_program_with_this_name')
False
}}}
would be a bit preferable to
{{{
sage: have_program('command')
True
sage: have_program('there_is_not_a_program_with_this_name')
False
}}}
as far more people will know what 'ls' is. I doubt many will realise there
is such a command called 'command'. I thought I knew Unix pretty well, but
I was unaware of it until today. But it is a very minor point.
So positive review from me. Change that docstring if you want, but
otherwise leave it unchanged.
I've also noticed a rather annoying message about a lack of ''xdg-open''
before. It looks like it might have been related - I see you have fixed
that too, so hopefully I won't see that any more.
I agree it is more logical to have one library function that works on any
system, rather than loads of different implementations which are not
portable.
Thank you very much John.
'''Note to the release manager'''
When this is merged, #8463 may be closed.
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8474#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.