summaryrefslogtreecommitdiff
path: root/src/chroot-tools/hooks-check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/hooks-check.sh')
-rw-r--r--src/chroot-tools/hooks-check.sh25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/chroot-tools/hooks-check.sh b/src/chroot-tools/hooks-check.sh
index e8120b8..2702f95 100644
--- a/src/chroot-tools/hooks-check.sh
+++ b/src/chroot-tools/hooks-check.sh
@@ -1,30 +1,11 @@
#!/usr/bin/env bash
set -euE
-hook_check_pkgbuild+=("check_pkgbuild_dependencies")
-check_pkgbuild_dependencies() {
+hook_check_pkgbuild+=("check_pkgbuild_nonfree")
+check_pkgbuild_nonfree() {
local s=0
sudo -EH -u "$LIBREUSER" pkgbuild-check-nonfree -f || s=$?
- case $s in
- 0) :;;
- 15) error "This PKGBUILD links to known unfree packages"; return 1;;
- *) warning "pkgbuild-check-nonfree failed to run";;
- esac
-}
-
-hook_check_pkgbuild+=("check_pkgbuild_license")
-check_pkgbuild_license() {
- local s=0
- sudo -EH -u "$LIBREUSER" pkgbuild-check-licenses -f || s=$?
- for i in 1 2 4; do
- if [[ $i -eq $(($s & $i)) ]]; then
- case $i in
- 1) warning "pkgbuild-check-licenses encountered an error";;
- 2) warning "This PKGBUILD has an uncommon license";;
- 4) error "This PKGBUILD has a known nonfree license"; ret=1;;
- esac
- fi
- done
+ pkgbuild-summarize-nonfree $s
}
#hook_check_pkgbuild+=("check_pkgbuild_namcap")