summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-10-25 15:33:40 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-10-25 15:33:40 (EDT)
commitbe9c85aa53cd0952992c55199cd5541c0c8ce11d (patch)
tree3ffbc589dad2d86dec1553a896d385d9e5b1103d /lib
parent58ac6317842e2f113912e60b895fdb722302e4b8 (diff)
Refactor printing logic in ob_parse_dep().
Diffstat (limited to 'lib')
-rw-r--r--lib/deps.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/deps.sh b/lib/deps.sh
index 03f0685..c5da438 100644
--- a/lib/deps.sh
+++ b/lib/deps.sh
@@ -119,19 +119,18 @@ ob_parse_dep()
eval ${_obpd_comp_var}=\"\$\{_obpd_${_obpd_comp}\}\"
done
- if [ -z "${_obpd_host_arch}" ]; then
- printf '%s' "${_obpd_pkg}"
- [ -n "${_obpd_archqual}" ] && printf ':%s' "${_obpd_archqual}"
- [ -n "${_obpd_ver}" ] && printf ' (%s %s)' "${_obpd_rel}" "${_obpd_ver}"
- [ -n "${_obpd_arches}" ] && printf ' [%s]' "${_obpd_arches}"
- printf '\n'
- elif _ob_dep_arch_is_concerned "${_obpd_host_arch}" "${_obpd_arches}"; then
- printf '%s' "${_obpd_pkg}"
- [ -n "${_obpd_archqual}" ] && printf ':%s' "${_obpd_archqual}"
- [ -n "${_obpd_ver}" ] && printf ' (%s %s)' "${_obpd_rel}" "${_obpd_ver}"
- printf '\n'
+ if [ -n "${_obpd_host_arch}" ] && ! _ob_dep_arch_is_concerned \
+ "${_obpd_host_arch}" "${_obpd_arches}"; then
+ _ob_return 0
+ return ${?}
fi
+ printf '%s' "${_obpd_pkg}"
+ [ -n "${_obpd_archqual}" ] && printf ':%s' "${_obpd_archqual}"
+ [ -n "${_obpd_ver}" ] && printf ' (%s %s)' "${_obpd_rel}" "${_obpd_ver}"
+ [ -z "${_obpd_host_arch}" -a -n "${_obpd_arches}" ] && \
+ printf ' [%s]' "${_obpd_arches}"
+
_ob_return 0
return ${?}
}