Bug#218530: Conditional command execution

2005-01-18 Thread Thomas Hood
(cc:ed to #218530) Guilherme de S. Pastore wrote to #289732: > The attached patches make your maintainer scripts behave just like a > package using debhelper would The patch makes use of "which". The problem with "which" is supposed to be that it is in /usr/bin/ and (as Ian Jackson wrote in #21

Bug#289732: Bug#218530: Conditional command execution

2005-01-19 Thread Tollef Fog Heen
* Thomas Hood | What is the best way to run a command if and only if it is on the PATH? findcommand() { while [ "$#" -ge 1 ]; do P="$PATH" while [ "$P" ]; do D=${P%%:*} P=${P#*:} if [ "$D" = "$P" ]; then P= fi