Gentoo Archives: gentoo-dev

From: Matthias Schwarzott <zzam@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] dont use `which` in ebuilds
Date: Tue, 13 Mar 2007 10:03:34
Message-Id: 200703131059.03286.zzam@gentoo.org
In Reply to: Re: [gentoo-dev] dont use `which` in ebuilds by Ned Ludd
1 On Dienstag, 13. März 2007, Ned Ludd wrote:
2 > On Mon, 2007-03-12 at 19:15 -0400, Mike Frysinger wrote:
3 > > On Monday 12 March 2007, Mike Frysinger wrote:
4 > > > instead, since we require bash for our ebuilds, use the builtin `type
5 > > > -p`
6 > >
7 > > err i botched that ;)
8 > >
9 > > `type -p` is almost a complete drop in replacement for which ... it does
10 > > not work on bash builtins however, so people should use `type -P` to
11 > > force the PATH search
12 > >
13 > > in other words, `type -p echo` would return "" while `type -P echo` would
14 > > return "/bin/echo"
15 > > -mike
16 >
17 > Quick search shows the following ebuilds are abusing this behavior.
18 >
19
20 The scripts installed by these ebuilds also use which:
21 sys-kernel/module-rebuild:
22 media-tv/vdrplugin-rebuild: (fixed)
23
24 R_PORTAGEQ="`which portageq 2>/dev/null`"
25
26 Matthias
27
28 --
29 Matthias Schwarzott (zzam)
30 --
31 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] dont use `which` in ebuilds Mike Frysinger <vapier@g.o>