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 ++++++++++++++++++---- .../libre-sources/libre-sources-2.6.30.ebuild | 2 +- .../libregentoo-sources-2.6.30-r1.ebuild | 2 -- 3 files changed, 29 insertions(+), 9 deletions(-) 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 diff --git a/sys-kernel/libre-sources/libre-sources-2.6.30.ebuild b/sys-kernel/libre-sources/libre-sources-2.6.30.ebuild index dfc113c..8ef9991 100644 --- a/sys-kernel/libre-sources/libre-sources-2.6.30.ebuild +++ b/sys-kernel/libre-sources/libre-sources-2.6.30.ebuild @@ -5,7 +5,7 @@ detect_version DESCRIPTION="Full sources for the BLOB free version of the Linux kernel" HOMEPAGE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" -SRC_URI="${LIBREKERNEL_URI}" +SRC_URI="${KERNEL_URI}" KEYWORDS="~amd64 ~x86" IUSE="" diff --git a/sys-kernel/libregentoo-sources/libregentoo-sources-2.6.30-r1.ebuild b/sys-kernel/libregentoo-sources/libregentoo-sources-2.6.30-r1.ebuild index 9c12530..6449dfa 100644 --- a/sys-kernel/libregentoo-sources/libregentoo-sources-2.6.30-r1.ebuild +++ b/sys-kernel/libregentoo-sources/libregentoo-sources-2.6.30-r1.ebuild @@ -14,5 +14,3 @@ http://dev.gentoo.org/~dsd/genpatches" DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} blob free version of the Linux kernel tree" SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${DEBLOB_URI}" - -# TODO: check patches with deblob script (do this in eclass) -- cgit v1.2.3