diff options
author | P. J. McDermott <pjm@nac.net> | 2012-09-09 17:31:23 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-09-09 17:33:04 (EDT) |
commit | 2f4be55e4c6e9aa3319458ba73a379e1bb8ed623 (patch) | |
tree | 465311056a065da048f33e0358c46f6dd1899011 | |
parent | 5b20da6573fba393a25d4f61dceb05a537628a99 (diff) |
Print parsed dep, reducing arches if host given.
-rw-r--r-- | lib/deps.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/deps.sh b/lib/deps.sh index 74b4bc6..0e23c94 100644 --- a/lib/deps.sh +++ b/lib/deps.sh @@ -87,7 +87,6 @@ ob_parse_dep() if [ "${_obpd_dep# \[*\]}" != "${_obpd_dep}" ]; then _obpd_arches="${_obpd_dep# \[}" _obpd_arches="${_obpd_arches%%\]*}" - # TODO: Reduce arch is host arch is given. fi # Set the specified variables. @@ -97,6 +96,19 @@ 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}"; then + printf '%s' "${_obpd_pkg}" + [ -n "${_obpd_archqual}" ] && printf ':%s' "${_obpd_archqual}" + [ -n "${_obpd_ver}" ] && printf ' (%s %s)' "${_obpd_rel}" "${_obpd_ver}" + printf '\n' + fi + _ob_return 0 return ${?} } |