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

Bug#807695: lintian: false positive for command-with-path-in-maintainer-script



Hi,

Jakub Wilk wrote:
> >If you don't wish to hard-code the path of a command in your
> >maintainer script, the following POSIX-compliant shell function
> >may help:
> >
> > pathfind() {
> >   OLDIFS="$IFS"
> >   IFS=:
> >   for p in $PATH; do
> >       if [ -x "$p/$*" ]; then
> >           IFS="$OLDIFS"
> >           return 0
> >       fi
> >   done
> >   IFS="$OLDIFS"
> >   return 1
> > }
> 
> Eww. There's no reason to use this monster in maintainer scripts.

Exactly.

> Please use which(1) instead. See also bug #747320.

Feel free to file a bug report against the Developer Reference.
("which" is mentioned there, too, but since it's under /usr/bin, it
has the restriction that it may not be available at early boot times.)

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE


Reply to: