From 33bbc2affa91f5ec62c8275be62a3a0da51ae2a9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 12 Mar 2019 22:14:20 -0400 Subject: ob_get_binary_packages(), _ob_set_binary_parameter(): Replace echo and grep with case --- diff --git a/lib/package.sh b/lib/package.sh index 24a6d01..bf21399 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -182,14 +182,12 @@ ob_get_binary_packages() "${pkg}" EOF )" - if echo "${pkgs_clean}" | grep " ${pkg_clean} " \ - >/dev/null 2>&1; then + case "${pkgs_clean}" in *" ${pkg_clean} "*) _ob_warn_msg 'duplicate_clean_binary_name' \ "${pkg_clean}" continue - else - pkgs_clean="${pkgs_clean}${pkg_clean} " - fi + esac + pkgs_clean="${pkgs_clean}${pkg_clean} " pkgs="${pkgs} ${pkg}" @@ -409,10 +407,13 @@ _ob_set_binary_parameter() EOF )" - if ! echo " ${_OB_BINARY_PARAMETERS} " | grep " ${name} " \ - >/dev/null 2>&1; then - _OB_BINARY_PARAMETERS="${_OB_BINARY_PARAMETERS} ${name}" - fi + case " ${_OB_BINARY_PARAMETERS} " in + *" ${name} "*) + ;; + *) + _OB_BINARY_PARAMETERS="${_OB_BINARY_PARAMETERS} ${name}" + ;; + esac eval "_OB_BINFIELD_${package}_${name}=\"\${value}\"" -- cgit v0.9.1