summaryrefslogtreecommitdiff
path: root/src/pkgbuild-summarize-nonfree
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-08-14 23:05:30 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-11-20 22:53:31 -0500
commite287e95fb62f8aad77b809e478026659cc974282 (patch)
treef701a7806fef40f141b3fee952f67eeda529c220 /src/pkgbuild-summarize-nonfree
parent1b77376ca488957cacdc8a0eccf9bd833339fd66 (diff)
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()
Diffstat (limited to 'src/pkgbuild-summarize-nonfree')
-rwxr-xr-xsrc/pkgbuild-summarize-nonfree24
1 files changed, 11 insertions, 13 deletions
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 <http://www.gnu.org/licenses/>.
+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