replace which' in fbsetbg and fbgm with
command -v'
This commit is contained in:
parent
1cad4ca517
commit
590b6c93d9
3 changed files with 14 additions and 60 deletions
|
@ -1,6 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
Changes for 1.0rc3:
|
||||||
*07/01/02:
|
*07/01/02:
|
||||||
|
* Replace `which' in fbsetbg and fbgm with `command -v' (Mark)
|
||||||
|
util/fbsetbg fluxbox-generate_menu.in
|
||||||
* Don't escape regular expression metacharacters in apps file, bug
|
* Don't escape regular expression metacharacters in apps file, bug
|
||||||
#1595497 (Mark)
|
#1595497 (Mark)
|
||||||
Remember.cc ClientPattern.cc
|
Remember.cc ClientPattern.cc
|
||||||
|
|
27
util/fbsetbg
27
util/fbsetbg
|
@ -131,28 +131,9 @@ Common tips to use with $command:
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
# some which's have a reliable return code, some don't
|
find_it() {
|
||||||
# Lets figure out which which we have.
|
command -v $1 > /dev/null 2>&1 && shift && $*
|
||||||
if which this_program_does_not_exist-no_really-aA1zZ9 >/dev/null 2>/dev/null; then
|
}
|
||||||
# can't rely on return value
|
|
||||||
find_it() {
|
|
||||||
file=`which $1 2> /dev/null`
|
|
||||||
if [ -x "$file" ]; then
|
|
||||||
if [ $# -gt 1 ]; then
|
|
||||||
shift
|
|
||||||
$*
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
else
|
|
||||||
# can rely on return value
|
|
||||||
find_it() {
|
|
||||||
which $1 > /dev/null 2>&1 && shift && $*
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
message() {
|
message() {
|
||||||
|
|
||||||
|
@ -349,7 +330,7 @@ if [ "$setterfromcommandline" != true ]; then
|
||||||
if [ ! "$wpsetter" = Esetroot ]; then
|
if [ ! "$wpsetter" = Esetroot ]; then
|
||||||
WPSETTER=$wpsetter
|
WPSETTER=$wpsetter
|
||||||
break
|
break
|
||||||
elif ldd `which Esetroot`|grep libImlib 2>&1 > /dev/null; then
|
elif ldd `command -v Esetroot`|grep libImlib 2>&1 > /dev/null; then
|
||||||
WPSETTER=$wpsetter
|
WPSETTER=$wpsetter
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -124,42 +124,13 @@ fluxbox-generate_menu was brought to you by:
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
# some which's have a reliable return code, some don't
|
find_it() {
|
||||||
# Lets figure out which which we have.
|
command -v $1 > /dev/null 2>&1 && shift && "$@"
|
||||||
if which this_program_does_not_exist-no_really-aA1zZ9 2> /dev/null 1> /dev/null; then
|
}
|
||||||
# can't rely on return value
|
|
||||||
find_it() {
|
|
||||||
file=`which $1 2> /dev/null`
|
|
||||||
if [ -x "$file" ]; then
|
|
||||||
if [ $# -gt 1 ]; then
|
|
||||||
shift
|
|
||||||
"$@"
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
find_it_options() {
|
find_it_options() {
|
||||||
file=`which $1 2> /dev/null`
|
command -v $1 > /dev/null 2>&1
|
||||||
if [ -x "$file" ]; then
|
}
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
# can rely on return value
|
|
||||||
find_it() {
|
|
||||||
which $1 > /dev/null 2>&1 && shift && "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
find_it_options() {
|
|
||||||
which $1 > /dev/null 2>&1
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
#echo "replaceWithinString: $1, $2, $3" >&2
|
#echo "replaceWithinString: $1, $2, $3" >&2
|
||||||
#echo ${1//$2/$3} # causes error in BSD even though not used
|
#echo ${1//$2/$3} # causes error in BSD even though not used
|
||||||
|
@ -211,7 +182,7 @@ convertIcon(){
|
||||||
if [ -f "${entry_icon}" ]; then
|
if [ -f "${entry_icon}" ]; then
|
||||||
: echo "File exists. To overwrite, type: convert \"$1\" \"$entry_icon\"" >&2
|
: echo "File exists. To overwrite, type: convert \"$1\" \"$entry_icon\"" >&2
|
||||||
else
|
else
|
||||||
if which convert &> /dev/null; then
|
if command -v convert &> /dev/null; then
|
||||||
convert "$1" "$entry_icon"
|
convert "$1" "$entry_icon"
|
||||||
# echo convert "$1" , "$entry_icon" >> $ICONMAPPING
|
# echo convert "$1" , "$entry_icon" >> $ICONMAPPING
|
||||||
else
|
else
|
||||||
|
@ -1378,7 +1349,7 @@ fi
|
||||||
# prefix
|
# prefix
|
||||||
PREFIX="${PREFIX:=@PREFIX@}"
|
PREFIX="${PREFIX:=@PREFIX@}"
|
||||||
if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then
|
if [ -z "${PREFIX}" -o ! -d "${PREFIX}" ]; then
|
||||||
PREFIX=`which fluxbox | sed 's,/bin/fluxbox$,,'`
|
PREFIX=`command -v fluxbox | sed 's,/bin/fluxbox$,,'`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue