From eb61e5fdf88724663adb698a129fdc4ce6b9bf37 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Sun, 15 Nov 2009 22:14:34 +0000 Subject: Replace "else if" by "elif". Minor fixes. svn path=/trunk/; revision=733 --- libs/skel.bash.in | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'libs') 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 } -- cgit v1.2.3-65-gdbad