summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/deps.sh47
1 files changed, 16 insertions, 31 deletions
diff --git a/lib/deps.sh b/lib/deps.sh
index 49d3cb2..72bfb47 100644
--- a/lib/deps.sh
+++ b/lib/deps.sh
@@ -22,17 +22,9 @@ _OB_DEPS_SM='true'
ob_parse_dep()
{
- _obpd_opt=
- _obpd_pkg_var=
- _obpd_archqual_var=
- _obpd_rel_var=
- _obpd_ver_var=
- _obpd_arches_var=
- _obpd_host_arch=
- _obpd_dep=
- _obpd_pkgarchqual=
- _obpd_relver=
- _obpd_arches=
+ _ob_local _obpd_opt _obpd_pkg_var _obpd_archqual_var _obpd_rel_var \
+ _obpd_ver_var _obpd_arches_var _obpd_host_arch _obpd_dep \
+ _obpd_pkgarchqual _obpd_relver _obpd_arches
while getopts 'p:q:r:v:A:a:' _obpd_opt; do
case "${_obpd_opt}" in
@@ -55,8 +47,7 @@ ob_parse_dep()
_obpd_host_arch="${OPTARG}"
;;
?)
- #unset
- return 125
+ return $(_ob_return 125)
;;
esac
done
@@ -69,8 +60,7 @@ ob_parse_dep()
# Remove leading, trailing, and duplicate spaces.
_obpd_dep="$(IFS=' ' echo ${_obpd_dep})"
else
- #unset
- return 125
+ return $(_ob_return 125)
fi
# <pkg>[:<archqual>] [(<rel> <ver>)] [\[<arches>\]]
@@ -105,18 +95,15 @@ ob_parse_dep()
fi
fi
- return 0
+ return $(_ob_return 0)
}
ob_reduce_deps()
{
- _obrd_opt=
- _obrd_host_arch=
+ _ob_local _obrd_opt _obrd_host_arch _obrd_deps \
+ _obrd_orig_ifs _obrd_dep_and _obrd_dep_or
+
_obrd_union=false
- _obrd_deps=
- _obrd_orig_ifs=
- _obrd_dep_and=
- _obrd_dep_or=
while getopts 'a:u' _obrd_opt; do
case "${_obrd_opt}" in
@@ -127,8 +114,7 @@ ob_reduce_deps()
_obrd_union=true
;;
?)
- #unset
- return 125
+ return $(_ob_return 125)
;;
esac
done
@@ -137,8 +123,7 @@ ob_reduce_deps()
if [ "${#}" -eq 1 ]; then
_obrd_deps="${1}"
else
- #unset
- return 125
+ return $(_ob_return 125)
fi
_obrd_orig_ifs="${IFS}"
@@ -154,15 +139,16 @@ ob_reduce_deps()
fi
done
- return 0
+ return $(_ob_return 0)
}
_ob_dep_arch_is_concerned()
{
+ _ob_local _obdaic_host_arch _obdaic_arches \
+ _obdaic_arch _obdaic_not_arch _obdaic_seen_arch
+
_obdaic_host_arch="${1}"
_obdaic_arches="${2}"
- _obdaic_arch=
- _obdaic_not_arch=
_obdaic_seen_arch=1
for _obdaic_arch in ${_obdaic_arches}; do
@@ -180,6 +166,5 @@ _ob_dep_arch_is_concerned()
fi
done
- unset _obdaic_host_arch _obdaic_arches _obdaic_arch _obdaic_not_arch
- return ${_obdaic_seen_arch}
+ return $(_ob_return ${_obdaic_seen_arch})
}