Michał Górny wrote:
> +systemd_install_serviced() {
> +     debug-print-function ${FUNCNAME} "${@}"
> +
> +     local src=${1}
> +     local service=${2}
> +
> +     if [[ ! ${service} ]]; then
> +             [[ ${src} == *.conf ]] || die "Source file needs .conf suffix"

I would hoist this check to before the if.

> +             service=${src##*/}
> +             service=${service%.conf}
> +     fi
> +     # avoid potentially common mistake
> +     [[ ${service} != *.d ]] || die "Service must not have .d suffix"

Double-negative reads badly:

  [[ $service = *.d ]] && die "$FUNCNAME: Service must not have .d suffix"

> Nope. 'insinto' sets INSDESTTREE. Due to lack of proper scoping
> support in bash, we need to localize this variable to restore previous
> 'insinto' scope after leaving the function.

Actually the only reason you are able to do that, is *because* bash has proper
scoping support.

-- 
#friendly-coders -- We're friendly, but we're not /that/ friendly ;-)

Reply via email to