comparison bin/check-ports @ 48:dfcbe14615b0

Refactor: replace an "if" by "case". This allows for easier maintainance of further "short" specials.
author Franz Glasner <hg@dom66.de>
date Wed, 22 Nov 2017 21:32:47 +0100
parents 1066c046c93b
children ffa6a61e77e8
comparison
equal deleted inserted replaced
47:0905457fb45b 48:dfcbe14615b0
183 if [ -n "${short_flag}" ]; then 183 if [ -n "${short_flag}" ]; then
184 # 184 #
185 # NOTE: -s and -A/-a are incompatible: so "alldata_XXX" needs not 185 # NOTE: -s and -A/-a are incompatible: so "alldata_XXX" needs not
186 # to be checked! 186 # to be checked!
187 # 187 #
188 if [ "${repository}" != "${FREEBSD_REPO}" -o "${llabel}" != '<' -o "${remote_FreeBSD_label}" != '=' -o "${remote_LocalRepo_label}" != '?' -o "${remote_LocalBSDPorts_label}" != '?' ]; then 188 case "${repository}" in
189 _print_detail=1 189 "${FREEBSD_REPO}")
190 fi 190 if [ "${llabel}" != '<' -o "${remote_FreeBSD_label}" != '=' -o "${remote_LocalRepo_label}" != '?' -o "${remote_LocalBSDPorts_label}" != '?' ]; then
191 _print_detail=1
192 fi
193 ;;
194 "${LOCAL_REPO}")
195 _print_detail=1
196 ;;
197 "${LOCALBSDPORTS_REPO}")
198 _print_detail=1
199 ;;
200 "${PORTS_DIRECT_INSTALLED_REPO}")
201 _print_detail=1
202 ;;
203 *)
204 echo "ERROR: unhandled repository: ${repository}" <&2
205 exit 1
206 ;;
207 esac
191 else 208 else
192 _print_detail=1 209 _print_detail=1
193 fi 210 fi
194 if [ -n "${_print_detail}" ]; then 211 if [ -n "${_print_detail}" ]; then
195 print_title "${lfqp}" "${repository}" 212 print_title "${lfqp}" "${repository}"