summaryrefslogtreecommitdiff
path: root/src/pkgbuild-summarize-nonfree
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkgbuild-summarize-nonfree')
-rwxr-xr-xsrc/pkgbuild-summarize-nonfree18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pkgbuild-summarize-nonfree b/src/pkgbuild-summarize-nonfree
index cf9277e..b036dd5 100755
--- a/src/pkgbuild-summarize-nonfree
+++ b/src/pkgbuild-summarize-nonfree
@@ -46,19 +46,19 @@ main() {
while getopts 'qh' arg; do
case "$arg" in
q) quiet=true;;
- h) usage; return 0;;
- *) usage >&2; return 1;;
+ h) usage; exit $EXIT_SUCCESS;;
+ *) usage >&2; exit $EXIT_INVALIDARGUMENT;;
esac
done
shift $((OPTIND - 1))
if [[ $# -ne 1 ]]; then
usage >&2
- return 1
+ exit $EXIT_INVALIDARGUMENT
fi
if ! [[ $1 =~ ^[0-9]+$ ]]; then
error 'STATUS must be an integer'
usage >&2
- return 1
+ exit $EXIT_INVALIDARGUMENT
fi
if $quiet; then
@@ -73,7 +73,7 @@ parse() {
[[ $# == 1 ]] || panic 'malformed call to parse'
declare -i s=$1;
- declare -i ret=0
+ declare -i ret=$EXIT_SUCCESS
declare -i i
for i in 1 2 4 8 16 32; do
if [[ $((s & i)) -gt 0 ]]; then
@@ -81,20 +81,20 @@ parse() {
$_E_ERROR)
# could be anything, assume the worst
error "There was an error processing the PKGBUILD"
- ret=1;;
+ 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=1;;
+ ret=$EXIT_FAILURE;;
$_E_DEP_NONFREE)
error "This PKGBUILD depends on known nonfree packages"
- ret=1;;
+ ret=$EXIT_FAILURE;;
$_E_PKG_NONFREE)
error "This PKGBUILD is for a known nonfree package"
- ret=1;;
+ ret=$EXIT_FAILURE;;
esac
fi
done