Re: command -v in postinsts violating policy
- To: debian-devel@lists.debian.org
- Subject: Re: command -v in postinsts violating policy
- From: Mark van Walraven <markv@wave.co.nz>
- Date: Sun, 21 Jul 2002 18:45:25 +1200
- Message-id: <[🔎] 20020721184525.A27160@wave.co.nz>
- Mail-followup-to: markv@wave.co.nz, debian-devel@lists.debian.org
- In-reply-to: <20020527033620.GG7707@deadbeast.net>; from branden@debian.org on Sun, May 26, 2002 at 10:36:20PM -0500
- References: <20020525194240.GA12041@dman.com> <20020525202835.GI7707@deadbeast.net> <20020525211902.GF24799@linuxasylum.net> <20020525233306.GK7707@deadbeast.net> <20020526073136.GC26522@linuxasylum.net> <20020526210629.GC7707@deadbeast.net> <20020527002703.GB5238@kitenet.net> <20020527033620.GG7707@deadbeast.net>
On Sun, May 26, 2002 at 10:36:20PM -0500, Branden Robinson wrote:
> Ideally, I want:
>
> 1) a command that searches $PATH for an executable of the given name,
> ignoring aliases and shell functions
> 2) a command that with a flag can be told not to spew any output under
> any circumstances (a la grep -qs)
> 3) a command that doesn't demand that we declare dependencies or
> pre-dependencies on a package just so we can use it our maintainer
> scripts
Taking a slight liberty with #2, would something along these lines suffice?
spath () {
IFS=':'
for DIR in $PATH ; do
test -x $DIR/$1 && echo $DIR/$1 && unset IFS && return
done
unset IFS
false
}
spath_quiet () {
IFS=':'
for DIR in $PATH ; do
test -x $DIR/$1 && unset IFS && return
done
unset IFS
false
}
Disclaimer: I must be nuts.
Mark.
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: