diff options
-rw-r--r-- | lib/buildsystem.sh | 42 | ||||
-rw-r--r-- | lib/buildsystem/kbuild.sh | 9 | ||||
-rw-r--r-- | lib/buildsystem/make.sh | 3 | ||||
-rw-r--r-- | lib/load.sh | 8 | ||||
-rw-r--r-- | lib/locale.sh | 11 |
5 files changed, 15 insertions, 58 deletions
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')" diff --git a/lib/buildsystem/kbuild.sh b/lib/buildsystem/kbuild.sh index ae548f9..83ecb35 100644 --- a/lib/buildsystem/kbuild.sh +++ b/lib/buildsystem/kbuild.sh @@ -70,12 +70,11 @@ _oh_kbuild_install() _oh_kbuild_update_target() { - local target= + local target="${1}" local arch= local rc= - target="${1}" - shift + shift 1 if ! arch="$(oh_buildsystem_arch "${OPK_HOST_ARCH}" 'kbuild')" then @@ -106,11 +105,9 @@ _oh_kbuild_update_target() _oh_kbuild_testarch() { - local arch= + local arch="${1}" local rc= - arch="${1}" - mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}" cd "${_OH_BUILDSYSTEM_BUILD_DIR}" diff --git a/lib/buildsystem/make.sh b/lib/buildsystem/make.sh index a6c4dc2..2837b9d 100644 --- a/lib/buildsystem/make.sh +++ b/lib/buildsystem/make.sh @@ -83,11 +83,10 @@ _oh_make_install() _oh_make_update_first_defined_target() { - local targets= + local targets="${1}" local target= local rc= - targets="${1}" shift mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}" diff --git a/lib/load.sh b/lib/load.sh index d376084..7dbb3b6 100644 --- a/lib/load.sh +++ b/lib/load.sh @@ -26,13 +26,7 @@ _OH_LOAD_SM=1 oh_use() { - local module= - - if [ ${#} -eq 1 ]; then - module="${1}" - else - return 125 - fi + local module="${1}" module='@pkgdatadir@'"/${module}.sm" if [ -r "${module}" ]; then diff --git a/lib/locale.sh b/lib/locale.sh index 1bd3c6c..f53611d 100644 --- a/lib/locale.sh +++ b/lib/locale.sh @@ -54,13 +54,7 @@ oh_load_locale() oh_get_msg() { - local msgid= - - if [ ${#} -eq 1 ]; then - msgid="${1}" - else - return 125 - fi + local msgid="${1}" eval "printf '%s' \"\${msg_${_OH_TEXT_DOMAIN}_${msgid}}\"" @@ -69,10 +63,9 @@ oh_get_msg() _oh_try_load_messages() { - local locale= + local locale="${1}" local ms= - locale="${1}" ms="$(printf "${_OH_LOCALE_PATH}" \ "${locale}" "${_OH_TEXT_DOMAIN}")" |