diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/pkgbuild-check-licenses | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/pkgbuild-check-licenses b/src/pkgbuild-check-licenses index 7dfe309..8b8f703 100755 --- a/src/pkgbuild-check-licenses +++ b/src/pkgbuild-check-licenses @@ -38,11 +38,11 @@ check_licenses() ( local pkgbuild=$1 . "$pkgbuild" if [[ -z $pkgname ]]; then - return 1 # not a PKGBUILD + return $_E_ERROR # not a PKGBUILD fi if [[ -z "${license[*]}" ]]; then error "license array of ${pkgbase:-${pkgname[0]}} $(get_full_version) is not set" - return 1 + return $_E_ERROR fi msg2 "Looking at license array of ${pkgbase:-${pkgname[0]}} $(get_full_version)" @@ -53,23 +53,24 @@ check_licenses() ( local s=$_E_OK case "${_license#custom:}" in WTFPL) - # accept as common, I think it should be in the licenses package. + # accept as common, I think it should be in the licenses package :;; BSD1|BSD2|BSD3|MIT|X11) - # accept these as common; they can't be included in the licenses package because some of the text must be customized + # accept these as common; they can't be included in the + # 'licenses' package because some text must be customized :;; BSD4) warning "The 4-clause BSD license is free but has practical problems.";; BSD) - warning "License \"BSD\" is ambiguous, please use one of \"BSD{1..4}\" to specify the number of clauses." + warning "License 'BSD' is ambiguous, use 'BSD{1..4}' to specify the number of clauses." s=$_E_UNCOMMON ;; JSON) - error "License \"$_license\" is a known non-free license." + error "License '%s' is a known non-free license." "$_license" s=$_E_NONFREE ;; *) - warning "License \"$_license\" is not a common license." + warning "License '%s' is not a common license." "$_license" s=$_E_UNCOMMON ;; esac @@ -105,8 +106,8 @@ main() { while getopts 'fh' arg; do case "$arg" in f) asroot=true;; - h) usage; return 0;; - *) usage; return 1;; + h) usage; return $_E_OK;; + *) usage; return $_E_ERROR;; esac done shift $(($OPTIND - 1)) @@ -121,7 +122,7 @@ main() { return 1 fi - blacklist-update || return 1 + blacklist-update || return $_E_ERROR local ret=0 for pkgbuild in "${pkgbuilds[@]}"; do |