summaryrefslogtreecommitdiff
path: root/src/pkgbuild-summarize-nonfree
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-07-14 09:45:44 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-11-20 22:53:30 -0500
commit3c86b7cd19def6c0b9c41ab8868ff3c07bf742a3 (patch)
tree29cd8e5419d68afb45b13bed691ef030f5e78cfb /src/pkgbuild-summarize-nonfree
parentd3a4b74c817fc8aa7fbcc67195ac2af3f1c7d66b (diff)
whitespace
Diffstat (limited to 'src/pkgbuild-summarize-nonfree')
-rwxr-xr-xsrc/pkgbuild-summarize-nonfree122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/pkgbuild-summarize-nonfree b/src/pkgbuild-summarize-nonfree
index fe0e342..dd063bc 100755
--- a/src/pkgbuild-summarize-nonfree
+++ b/src/pkgbuild-summarize-nonfree
@@ -31,78 +31,78 @@ declare -ri _E_PKG_NONFREE=32
usage() {
- print "Usage: %s [OPTIONS] STATUS" "${0##*/}"
- print "Summarizes a status code from pkgbuild-check-nonfree"
- echo
- prose 'It thresholds the issues it finds, only failing for error-level
- issues, and ignoring warnings. Unless `-q` is specified, it also
- prints a summary of the issues it found.'
- echo
- print 'Options:'
- flag '-q' 'Be quiet'
- flag '-h' 'Show this message'
+ print "Usage: %s [OPTIONS] STATUS" "${0##*/}"
+ print "Summarizes a status code from pkgbuild-check-nonfree"
+ echo
+ prose 'It thresholds the issues it finds, only failing for error-level
+ issues, and ignoring warnings. Unless `-q` is specified, it also
+ prints a summary of the issues it found.'
+ echo
+ print 'Options:'
+ flag '-q' 'Be quiet'
+ flag '-h' 'Show this message'
}
main() {
- local quiet=false
- while getopts 'qh' arg; do
- case "$arg" in
- q) quiet=true;;
- h) usage; exit $EXIT_SUCCESS;;
- *) usage >&2; exit $EXIT_INVALIDARGUMENT;;
- esac
- done
- shift $((OPTIND - 1))
- if [[ $# -ne 1 ]]; then
- usage >&2
- exit $EXIT_INVALIDARGUMENT
- fi
- if ! [[ $1 =~ ^[0-9]+$ ]]; then
- error 'STATUS must be an integer'
- usage >&2
- exit $EXIT_INVALIDARGUMENT
- fi
+ local quiet=false
+ while getopts 'qh' arg; do
+ case "$arg" in
+ q) quiet=true;;
+ h) usage; exit $EXIT_SUCCESS;;
+ *) usage >&2; exit $EXIT_INVALIDARGUMENT;;
+ esac
+ done
+ shift $((OPTIND - 1))
+ if [[ $# -ne 1 ]]; then
+ usage >&2
+ exit $EXIT_INVALIDARGUMENT
+ fi
+ if ! [[ $1 =~ ^[0-9]+$ ]]; then
+ error 'STATUS must be an integer'
+ usage >&2
+ exit $EXIT_INVALIDARGUMENT
+ fi
- if $quiet; then
- error() { :; }
- warning() { :; }
- fi
+ if $quiet; then
+ error() { :; }
+ warning() { :; }
+ fi
- parse "$1"
+ parse "$1"
}
parse() {
- [[ $# == 1 ]] || panic 'malformed call to parse'
- declare -i s=$1;
+ [[ $# == 1 ]] || panic 'malformed call to parse'
- declare -i ret=$EXIT_SUCCESS
- declare -i i
+ declare -i s=$1;
+ declare -i ret=$EXIT_SUCCESS
+ declare -i i
- for i in 1 2 4 8 16 32; do
- if [[ $((s & i)) -gt 0 ]]; then
- case $i in
- $_E_ERROR)
- # could be anything, assume the worst
- error "There was an error processing the PKGBUILD"
- ret=$EXIT_FAILURE;;
- $_E_LIC_UNKNOWN)
- warning "This PKGBUILD has an unknown license";;
- $_E_LIC_NOGPL)
- warning "This PKGBUILD has a GPL-incompatible license";;
- $_E_LIC_NONFREE)
- error "This PKGBUILD has a known nonfree license"
- ret=$EXIT_FAILURE;;
- $_E_DEP_NONFREE)
- error "This PKGBUILD depends on known nonfree packages"
- ret=$EXIT_FAILURE;;
- $_E_PKG_NONFREE)
- error "This PKGBUILD is for a known nonfree package"
- ret=$EXIT_FAILURE;;
- esac
- fi
- done
+ for i in 1 2 4 8 16 32; do
+ if [[ $((s & i)) -gt 0 ]]; then
+ case $i in
+ $_E_ERROR)
+ # could be anything, assume the worst
+ error "There was an error processing the PKGBUILD"
+ ret=$EXIT_FAILURE;;
+ $_E_LIC_UNKNOWN)
+ warning "This PKGBUILD has an unknown license";;
+ $_E_LIC_NOGPL)
+ warning "This PKGBUILD has a GPL-incompatible license";;
+ $_E_LIC_NONFREE)
+ error "This PKGBUILD has a known nonfree license"
+ ret=$EXIT_FAILURE;;
+ $_E_DEP_NONFREE)
+ error "This PKGBUILD depends on known nonfree packages"
+ ret=$EXIT_FAILURE;;
+ $_E_PKG_NONFREE)
+ error "This PKGBUILD is for a known nonfree package"
+ ret=$EXIT_FAILURE;;
+ esac
+ fi
+ done
- return $ret
+ return $ret
}