From abda548dbd0195ce04547f5fc89188662995f0e4 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 16 Jun 2009 12:11:39 +0100 Subject: Check patches for blobs, and fix uri setting --- eclass/kernel-libre.eclass | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'eclass') diff --git a/eclass/kernel-libre.eclass b/eclass/kernel-libre.eclass index a042ab1..483015a 100644 --- a/eclass/kernel-libre.eclass +++ b/eclass/kernel-libre.eclass @@ -8,20 +8,42 @@ # inherit kernel-2 -EXPORT_FUNCTIONS pkg_setup src_unpack +EXPORT_FUNCTIONS src_unpack -kernel-libre_pkg_setup() { - libre_uri_base="http://www.linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-libre" +DEBLOB_CHECK="deblob-check" +KERNEL_URI="http://www.linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-libre/linux-${PV}-libre.tar.bz2" +DEBLOB_URI="http://www.linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-libre/${DEBLOB_CHECK}" - DEBLOB_CHECK="deblob-check" - KERNEL_URI="${LIBRE_URI_BASE}/linux-${PV}-libre.tar.bz2" - DEBLOB_URI="${LIBRE_URI_BASE}/${DEBLOB_CHECK}" +check_for_blobs() { + # usage: check_for_blobs name_of_variable_containing_paths_to_check + # we want the name of a variable (not just its contents) + # so can unset it if blobs are found + + [[ -z "${!1}" ]] && return 1 + + sh ${DISTDIR}/${DEBLOB_CHECK} ${!1} + + if [ $? -ne 0 ]; then + ewarn "Warning: A file in ${1} appears to contain blobs." + ewarn "Disabling ${1} for now." + eval "${1}=''" + ewarn "Please report this to http://bugs.gentoo.org/266157" + return 1 + fi + + return 0 } kernel-libre_src_unpack() { # kernel revision patches included in tarball UNIPATCH_LIST_DEFAULT="" + if [ -n ${UNIPATCH_LIST_GENPATCHES} || -n ${UNIPATCH_LIST} ]; then + echo "Checking all patches are clean of blobs" + check_for_blobs "UNIPATCH_LIST_GENPATCHES" + check_for_blobs "UNIPATCH_LIST" + fi + # universal_unpack expects a different kernel tarball name expected_tarball=${DISTDIR}/linux-${OKV}.tar.bz2 -- cgit v1.2.3