From 6c229db00449a0cfc4258c44e36247d0f6826173 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 06 Mar 2014 11:45:14 -0500 Subject: lib/*.sh: Consolidate arg variable assignments. --- (limited to 'lib/buildsystem.sh') diff --git a/lib/buildsystem.sh b/lib/buildsystem.sh index 836f31e..29b6900 100644 --- a/lib/buildsystem.sh +++ b/lib/buildsystem.sh @@ -48,15 +48,8 @@ oh_buildsystems_init() oh_set_buildsystem_option() { - local name= - local value= - - if [ ${#} -eq 2 ]; then - name="${1}" - value="${2}" - else - return 125 - fi + local name="${1}" + local value="${2}" case "${name}" in 'source-dir') @@ -89,15 +82,9 @@ oh_set_buildsystem_option() oh_buildsystem_find() { - local test_step= + local test_step="${1}" local bs= - if [ ${#} -eq 1 ]; then - test_step="${1}" - else - return 125 - fi - if [ "x${_OH_BUILDSYSTEM_SYSTEM}" != 'x' ]; then if "_oh_${_OH_BUILDSYSTEM_SYSTEM}_can_${test_step}"; then printf '%s\n' "${_OH_BUILDSYSTEM_SYSTEM}" @@ -118,16 +105,10 @@ oh_buildsystem_find() oh_buildsystem_do() { - local step= - local system= + local step="${1}" + local system="${2}" - if [ ${#} -ge 2 ]; then - step="${1}" - system="${2}" - shift 2 - else - return 125 - fi + shift 2 "_oh_${system}_${step}" "${@}" @@ -136,16 +117,9 @@ oh_buildsystem_do() oh_buildsystem_arch() { - local arch= + local arch="${1}" + local system="${2}" local bs_arch= - local system= - - if [ ${#} -eq 2 ]; then - arch="${1}" - system="${2}" - else - return 125 - fi if [ "x${system}" = 'x' ]; then system="$(oh_buildsystem_find 'configure')" -- cgit v0.9.1