aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2009-11-15 22:14:34 +0000
committerUlrich Müller <ulm@gentoo.org>2009-11-15 22:14:34 +0000
commiteb61e5fdf88724663adb698a129fdc4ce6b9bf37 (patch)
treefb5fa8a6a274abd1c88e71a4a3da0a90f2c25c0b /libs
parentUse EPREFIX in skel library when called from ebuild, bug 293317. (diff)
downloadeselect-eb61e5fdf88724663adb698a129fdc4ce6b9bf37.tar.gz
eselect-eb61e5fdf88724663adb698a129fdc4ce6b9bf37.tar.bz2
eselect-eb61e5fdf88724663adb698a129fdc4ce6b9bf37.zip
Replace "else if" by "elif". Minor fixes.
svn path=/trunk/; revision=733
Diffstat (limited to 'libs')
-rw-r--r--libs/skel.bash.in19
1 files changed, 8 insertions, 11 deletions
diff --git a/libs/skel.bash.in b/libs/skel.bash.in
index ba8bcf3..a6343c5 100644
--- a/libs/skel.bash.in
+++ b/libs/skel.bash.in
@@ -50,7 +50,7 @@ find_implems() {
# is_active $iface $libdir $implem
# returns true if $implem is currently used for the $iface/$libdir combination
is_active() {
- [[ ${#@} -eq 3 ]] || die "Need exactly 3 arguments!"
+ [[ $# -eq 3 ]] || die "Need exactly 3 arguments!"
current=$(load_config "${EROOT}/etc/env.d/${1}/${2}/config" CURRENT)
[[ ${current} == ${3} ]]
}
@@ -59,7 +59,7 @@ is_active() {
# switches $iface/$libdir combination to $implem
switch_implem() {
# set us up
- [[ ${#@} -eq 3 ]] || die "Need exactly 3 arguments!"
+ [[ $# -eq 3 ]] || die "Need exactly 3 arguments!"
local iface=${1}
local libdir=${2}
local implem=${3##*/}
@@ -170,8 +170,7 @@ describe_set_options() {
}
do_set() {
- [[ ${#@} == 0 ]] \
- && die -q "Please specify exactly 1 implementation!"
+ [[ $# -eq 0 ]] && die -q "Please specify exactly 1 implementation!"
local fail=0 iface=$IFACE
local libdirs=$(get_libdirs)
local libdir implem libdir_ct i=0
@@ -288,8 +287,8 @@ describe_add_options() {
}
do_add() {
- [[ ${#@} -ne 3 ]] \
- && die -q "Please specify 1 library directory, 1 file to install and 1 implementation!"
+ [[ $# -eq 3 ]] \
+ || die -q "Please specify 1 library directory, 1 file to install and 1 implementation!"
# If $D is set, we're adding from portage so we want to respect sandbox.
# Otherwise, respect the ROOT variable.
@@ -298,13 +297,11 @@ do_add() {
# Create directory if necessary
if [[ ! -e ${prefix}/etc/env.d/${IFACE}/${1} ]]; then
mkdir -p "${prefix}/etc/env.d/${IFACE}/${1}"
- else
- if [[ ! -d ${prefix}/etc/env.d/${IFACE}/${1} ]]; then
- die -q "${prefix}/etc/env.d/${IFACE}/${1} exists but isn't a directory!"
- fi
+ elif [[ ! -d ${prefix}/etc/env.d/${IFACE}/${1} ]]; then
+ die -q "${prefix}/etc/env.d/${IFACE}/${1} exists but isn't a directory!"
fi
- if ! cp ${2} "${prefix}/etc/env.d/${IFACE}/${1}/${3}"; then
+ if ! cp "${2}" "${prefix}/etc/env.d/${IFACE}/${1}/${3}"; then
die -q "Installing ${2} as ${prefix}/etc/env.d/${IFACE}/${1}/${3} failed!"
fi
}