From 34f21a5b49952dcb80acde5fafd85267c69e3b1d Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 19:21:53 -0400 Subject: ob_parse_dep(): Swap -p and -P option letters Be consistent with opkbuild and other executable CLIs. --- (limited to 'lib') diff --git a/lib/deps.sh b/lib/deps.sh index 9ae63fe..bc524cc 100644 --- a/lib/deps.sh +++ b/lib/deps.sh @@ -22,7 +22,7 @@ ## \fIpkg:archqual (rel ver) [arches] \fP, where the components ## \fI:archqual\fP, \fI(rel ver)\fP, \fI[arches]\fP, and \fI\fP ## are optional. -## @option -p pkg_var The name of the variable in which to store the +## @option -P pkg_var The name of the variable in which to store the ## package name. ## @option -q archqual_var The name of the variable in which to store the ## architecture qualifier, if any. @@ -37,20 +37,20 @@ ## @option -a host_arch The host architecture. If given, the dependency will ## only be printed on standard output if it applies to ## the given architecture. -## @option -P host_plat The host platform. If given, the dependency will +## @option -p host_plat The host platform. If given, the dependency will ## only be printed on standard output if it applies to ## the given platform. ## @operand dep req The dependency to parse. ## @return Returns 0. -## @stdout If \fB-a\fP and \fB\P\fP aren't given, the entire dependency string -## is printed, with normalized formatting. If \fB-a\fP and/or \fB-P\fP +## @stdout If \fB-a\fP and \fB\p\fP aren't given, the entire dependency string +## is printed, with normalized formatting. If \fB-a\fP and/or \fB-p\fP ## are given and the dependency applies to their arguments, the ## dependency string is printed, except for the architecture (if -## \fB-a\fP given) and/or platform (if \fB-P\fP given) restrictions, +## \fB-a\fP given) and/or platform (if \fB-p\fP given) restrictions, ## with normalized formatting. Normalized formatting is a string of the ## format \fIpkg:archqual\ (rel\ ver)\ [arches]\ \fP. ## @pure maybe This function has side effects when used with any of the options -## \fB-p\fP, \fB-q\fP, \fB-r\fP, \fB-v\fP, \fB-A\fP, or \fB-l\fP. +## \fB-P\fP, \fB-q\fP, \fB-r\fP, \fB-v\fP, \fB-A\fP, or \fB-l\fP. ob_parse_dep() { local opt= @@ -74,9 +74,9 @@ ob_parse_dep() local comp_var= OPTIND=1 - while getopts 'p:q:r:v:A:l:a:P:' opt; do + while getopts 'P:q:r:v:A:l:a:p:' opt; do case "${opt}" in - p) + P) pkg_var="${OPTARG}" if ! _ob_validate_var_name "${pkg_var}"; then _ob_abort @@ -115,7 +115,7 @@ ob_parse_dep() a) host_arch="${OPTARG}" ;; - P) + p) host_plat="${OPTARG}" ;; ?) @@ -245,7 +245,7 @@ ob_reduce_deps() for dep_or in ${dep_and}; do unset IFS dep="$(ob_parse_dep -a "${host_arch}" \ - -P "${host_plat}" "${dep_or}")" + -p "${host_plat}" "${dep_or}")" if [ -n "${dep}" ]; then if [ -n "${dep_or_list}" ]; then dep_or_list="${dep_or_list} | " @@ -262,7 +262,7 @@ ob_reduce_deps() fi else dep="$(ob_parse_dep -a "${host_arch}" \ - -P "${host_plat}" "${dep_and}")" + -p "${host_plat}" "${dep_and}")" if [ -n "${dep}" ]; then if [ -n "${dep_list}" ]; then dep_list="${dep_list}, " -- cgit v0.9.1