From 32a2c02e527b707e4279931bcc4beb1be4e35476 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 05 Nov 2012 18:20:10 -0500 Subject: Refactor ob_get_binary_packages() arch reduction. --- (limited to 'lib') diff --git a/lib/package.sh b/lib/package.sh index 3476e56..72ffd63 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -195,17 +195,14 @@ ob_get_binary_packages() _obgbpk_pkgs='' - if [ -n "${_obgbpk_host_arch}" ]; then - for _obgbpk_pkg in ${_OB_BINARY_PACKAGES}; do - if ob_arch_is_concerned "${_obgbpk_host_arch}" \ - "$(ob_get_binary_parameter \ - "${_obgbpk_pkg}" 'Architecture')"; then - _obgbpk_pkgs="${_obgbpk_pkgs} ${_obgbpk_pkg}" - fi - done - else - _obgbpk_pkgs="${_OB_BINARY_PACKAGES}" - fi + for _obgbpk_pkg in ${_OB_BINARY_PACKAGES}; do + if [ -n "${_obgbpk_host_arch}" ] && ! ob_arch_is_concerned \ + "${_obgbpk_host_arch}" "$(ob_get_binary_parameter \ + "${_obgbpk_pkg}" 'Architecture')"; then + continue + fi + _obgbpk_pkgs="${_obgbpk_pkgs} ${_obgbpk_pkg}" + done IFS=' ' echo ${_obgbpk_pkgs} -- cgit v0.9.1