summaryrefslogtreecommitdiffstats
path: root/lib/buildsystem.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2014-03-06 11:45:14 (EST)
committer P. J. McDermott <pjm@nac.net>2014-03-06 11:45:14 (EST)
commit6c229db00449a0cfc4258c44e36247d0f6826173 (patch)
tree7afbf36146e438f2e84d38c34e597027956f35ff /lib/buildsystem.sh
parent731e0cf0e59da3ee0b6bda99f70e8be4d54d4d08 (diff)
lib/*.sh: Consolidate arg variable assignments.
Diffstat (limited to 'lib/buildsystem.sh')
-rw-r--r--lib/buildsystem.sh42
1 files changed, 8 insertions, 34 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')"