From e287e95fb62f8aad77b809e478026659cc974282 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Fri, 14 Aug 2020 23:05:30 -0400 Subject: allow building replacements for existing blacklist entries libremakepkg will refuse to build a blacklisted package, if no libre replacement had been published before the next repo sync this change warns instead, and prompts for confirmation see note in src/chroot-tools/hooks-check.sh::check_pkgbuild_nonfree() --- src/pkgbuild-summarize-nonfree | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/pkgbuild-summarize-nonfree') diff --git a/src/pkgbuild-summarize-nonfree b/src/pkgbuild-summarize-nonfree index d622cf6..af220a8 100755 --- a/src/pkgbuild-summarize-nonfree +++ b/src/pkgbuild-summarize-nonfree @@ -19,16 +19,9 @@ # along with Parabola. If not, see . +source "$(librelib blacklist)" source "$(librelib messages)" -# Make sure these match pkgbuild-check-nonfree -declare -ri _E_ERROR=1 -declare -ri _E_LIC_UNKNOWN=2 -declare -ri _E_LIC_NOGPL=4 -declare -ri _E_LIC_NONFREE=8 -declare -ri _E_DEP_NONFREE=16 -declare -ri _E_PKG_NONFREE=32 - usage() { print "Usage: %s [OPTIONS] STATUS" "${0##*/}" @@ -41,14 +34,17 @@ usage() { print 'Options:' flag '-q' 'Be quiet' flag '-h' 'Show this message' + flag '-w' 'Treat blacklist entries as warnings' } main() { local quiet=false - while getopts 'qh' arg; do + local warn=false + while getopts 'qhw' arg; do case "$arg" in q) quiet=true;; h) usage; exit $EXIT_SUCCESS;; + w) warn=true;; *) usage >&2; exit $EXIT_INVALIDARGUMENT;; esac done @@ -93,11 +89,13 @@ parse() { error "This PKGBUILD has a non-free license" ret=$EXIT_FAILURE;; $_E_DEP_NONFREE) - error "This PKGBUILD depends on blacklisted package(s)" - ret=$EXIT_FAILURE;; + $warn && warning "This PKGBUILD depends on blacklisted package(s)" || \ + error "This PKGBUILD depends on blacklisted package(s)" + $warn || ret=$EXIT_FAILURE;; $_E_PKG_NONFREE) - error "This PKGBUILD is for a blacklisted package" - ret=$EXIT_FAILURE;; + $warn && warning "This PKGBUILD is for a blacklisted package" || \ + error "This PKGBUILD is for a blacklisted package" + $warn || ret=$EXIT_FAILURE;; esac fi done -- cgit v1.2.2