Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 599392 - eselect-java: Replace "/usr/bin/which" with "command -v"
Summary: eselect-java: Replace "/usr/bin/which" with "command -v"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Java team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: eselect-java-tracker
  Show dependency tree
 
Reported: 2016-11-10 13:46 UTC by Manuel Rüger (RETIRED)
Modified: 2016-11-28 23:02 UTC (History)
0 users

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


Attachments
Replace which with command-v (0001-Replace-which-with-command-v.patch,733 bytes, patch)
2016-11-10 13:46 UTC, Manuel Rüger (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rüger (RETIRED) gentoo-dev 2016-11-10 13:46:16 UTC
Created attachment 452904 [details, diff]
Replace which with command-v

On some systems /usr/bin/which might not be available, it's safer to use "command -v".

Patch attached.
Comment 1 Austin English (RETIRED) gentoo-dev 2016-11-22 19:08:52 UTC
(In reply to Manuel Rüger from comment #0)
> Created attachment 452904 [details, diff] [details, diff]
> Replace which with command-v
> 
> On some systems /usr/bin/which might not be available, it's safer to use
> "command -v".
> 
> Patch attached.

command -v doesn't require an external binary, but it's not POSIX either. bash/dash/zsh/csh/FreeBSD sh all support it, though busybox doesn't. I suspect plenty else wouldn't work under busybox though ;).

Why the quoting, though?
Comment 2 Manuel Rüger (RETIRED) gentoo-dev 2016-11-27 20:32:36 UTC
Yeah the quoting is not necessary.

I check busybox:

mrueg@euler ~ % bb
~ $ command -v eselect
/usr/bin/eselect


Seems to be supported there as well.
Comment 3 Austin English (RETIRED) gentoo-dev 2016-11-28 23:02:39 UTC
(In reply to Manuel Rüger from comment #2)
> Yeah the quoting is not necessary.
> 
> I check busybox:
> 
> mrueg@euler ~ % bb
> ~ $ command -v eselect
> /usr/bin/eselect
> 
> 
> Seems to be supported there as well.

Cool. I committed the modified patch here:
https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=4d7da7ac603f610fef687ea95357e7b727b19d03

and pushed a 0.3.0 ebuild here:
https://github.com/gentoo/gentoo/commit/588325937049c7ca75da537f615c961c64b7e2a4