diff options
Diffstat (limited to 'lib/deps.sh')
-rw-r--r-- | lib/deps.sh | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/lib/deps.sh b/lib/deps.sh index 64553aa..348839a 100644 --- a/lib/deps.sh +++ b/lib/deps.sh @@ -79,37 +79,37 @@ ob_parse_dep() p) pkg_var="${OPTARG}" if ! _ob_validate_var_name "${pkg_var}"; then - return 125 + _ob_abort fi ;; q) archqual_var="${OPTARG}" if ! _ob_validate_var_name "${archqual_var}"; then - return 125 + _ob_abort fi ;; r) rel_var="${OPTARG}" if ! _ob_validate_var_name "${rel_var}"; then - return 125 + _ob_abort fi ;; v) ver_var="${OPTARG}" if ! _ob_validate_var_name "${ver_var}"; then - return 125 + _ob_abort fi ;; A) arches_var="${OPTARG}" if ! _ob_validate_var_name "${arches_var}"; then - return 125 + _ob_abort fi ;; l) plats_var="${OPTARG}" if ! _ob_validate_var_name "${plats_var}"; then - return 125 + _ob_abort fi ;; a) @@ -119,17 +119,14 @@ ob_parse_dep() host_plat="${OPTARG}" ;; ?) - return 125 + _ob_abort ;; esac done shift $(($OPTIND - 1)) - if [ ${#} -eq 1 ]; then - dep="${1}" - else - return 125 - fi + dep="${1}" + shift 1 || _ob_abort # pkg[:archqual] [(rel ver)] [\[arches\]] [<plats>] dep_re='s/^ *([^ \(\[<]+) *(\((<<|<=|=|>=|>>) *(.+)\))?' @@ -200,7 +197,7 @@ ob_parse_dep() ## Required. ## @option -u - Treat \fIdeps\fP as a union list. ## @operand deps req The list of dependencies to reduce. -## @return Returns 0 on success or 125 on invalid option or missing \fIdeps\fP. +## @return Returns 0 on success. ## @stdout Prints the reduced list of dependencies. ## @pure yes This function has no side effects. ob_reduce_deps() @@ -230,17 +227,14 @@ ob_reduce_deps() union='true' ;; ?) - return 125 + _ob_abort ;; esac done shift $(($OPTIND - 1)) - if [ ${#} -eq 1 ]; then - deps="${1}" - else - return 125 - fi + local deps="${1}" + shift 1 || _ob_abort IFS=',' for dep_and in ${deps}; do |