Stop using needless {} in vars

This commit is contained in:
Roy Marples
2009-04-26 21:13:26 +00:00
parent 59574780da
commit 2b866f264f
11 changed files with 198 additions and 191 deletions

View File

@@ -1,25 +1,25 @@
# Copyright 2007 Gentoo Foundation
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# Copyright 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
has_addon()
{
[ -e "${RC_LIBDIR}/addons/$1.sh" ] || [ -e /@LIB@/rcscripts/addons/"$1".sh ]
[ -e "$RC_LIBDIR/addons/$1.sh" -o -e /@LIB@/rcscripts/addons/"$1".sh ]
}
_addon_warn()
{
eindent
ewarn "${RC_SVCNAME} uses addon code which is deprecated"
ewarn "$RC_SVCNAME uses addon code which is deprecated"
ewarn "and may not be available in the future."
eoutdent
}
import_addon()
{
if [ -e "${RC_LIBDIR}/addons/$1.sh" ]; then
if [ -e "$RC_LIBDIR/addons/$1.sh" ]; then
_addon_warn
. "${RC_LIBDIR}/addons/$1.sh"
. "$RC_LIBDIR/addons/$1.sh"
elif [ -e /@LIB@/rcscripts/addons/"$1".sh ]; then
_addon_warn
. /@LIB@/rcscripts/addons/"$1".sh
@@ -49,8 +49,8 @@ is_net_fs()
# Fall back on fs types
local t=$(mountinfo --fstype "$1")
for x in ${net_fs_list}; do
[ "${x}" = "${t}" ] && return 0
for x in $net_fs_list; do
[ "$x" = "$t" ] && return 0
done
return 1
}
@@ -64,17 +64,17 @@ is_union_fs()
get_bootparam()
{
local match="$1"
[ -z "${match}" -o ! -r /proc/cmdline ] && return 1
[ -z "$match" -o ! -r /proc/cmdline ] && return 1
set -- $(cat /proc/cmdline)
while [ -n "$1" ]; do
[ "$1" = "${match}" ] && return 0
[ "$1" = "$match" ] && return 0
case "$1" in
gentoo=*)
local params="${1##*=}"
local IFS=, x=
for x in ${params}; do
[ "${x}" = "${match}" ] && return 0
for x in $params; do
[ "$x" = "$match" ] && return 0
done
;;
esac
@@ -85,7 +85,7 @@ get_bootparam()
}
# Add our sbin to $PATH
case "${PATH}" in
"${RC_LIBDIR}"/sbin|"${RC_LIBDIR}"/sbin:*);;
*) export PATH="${RC_LIBDIR}/sbin:${PATH}";;
case "$PATH" in
"$RC_LIBDIR"/sbin|"$RC_LIBDIR"/sbin:*);;
*) export PATH="$RC_LIBDIR/sbin:$PATH";;
esac