[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is `command -v' accepted for maintainer scripts?

On Sat, 09 Sep 2006 09:31:47 +0900 (JST), Tatsuya Kinoshita <tats@debian.org> said: 

> Hi, I've discovered that my adopted packages dbskkd-cdb and
> skksearch use `command -v'.

> Is `command -v' accepted for `/bin/sh' maintainer scripts?

> AFAIK, `command -v' is defined by POSIX UPE (user portability
> extension), "Debian Policy" section 10.4 says `/bin/sh' should only
> use POSIX features, "Developer's Reference" section 6.4 says it is
> "not POSIX", and several packages, such as libc6, exim4-base,
> exim4-command, bzip2, slib, gettext-doc, use it.

        I prefer the ditty of:
 if which foo >/dev/null 2>&1; then
    foo "stuff";

        /usr/bin/which belongs in debianutils, which is Essential:
 Yes, and is thus safe to use in maintainer scripts.

Against stupidity the very gods Themselves contend in vain. Friedrich
von Schiller, "The Maid of Orleans", III, 6
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply to: