From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6CE0F138890 for ; Tue, 5 Feb 2013 20:20:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 163A521C031; Tue, 5 Feb 2013 20:19:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AE98221C022 for ; Tue, 5 Feb 2013 20:19:31 +0000 (UTC) Received: from pomiocik.lan (213-238-96-111.adsl.inetia.pl [213.238.96.111]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id DD47F33DE83; Tue, 5 Feb 2013 20:19:29 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: kde@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/3] Move header consistency checking func into multilib-build. Date: Tue, 5 Feb 2013 21:19:22 +0100 Message-Id: <1360095564-18154-2-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360095564-18154-1-git-send-email-mgorny@gentoo.org> References: <1360095564-18154-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 27bb92de-75f8-479f-ab99-1c7224730e08 X-Archives-Hash: c96ffa3130314033d0f36d1d6876bff8 There it can be reused by eclasses & ebuilds. --- gx86/eclass/autotools-multilib.eclass | 29 +------------------------- gx86/eclass/multilib-build.eclass | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass index 97abfe6..ff7e8b8 100644 --- a/gx86/eclass/autotools-multilib.eclass +++ b/gx86/eclass/autotools-multilib.eclass @@ -50,34 +50,7 @@ autotools-multilib_src_install() { autotools-utils_src_install # Make sure all headers are the same for each ABI. - autotools-multilib_cksum() { - find "${ED}"usr/include -type f \ - -exec cksum {} + | sort -k2 - } - - local cksum=$(autotools-multilib_cksum) - local cksum_file=${T}/.autotools-multilib_cksum - - if [[ -f ${cksum_file} ]]; then - local cksum_prev=$(< "${cksum_file}") - - if [[ ${cksum} != ${cksum_prev} ]]; then - echo "${cksum}" > "${cksum_file}.new" - - eerror "Header files have changed between ABIs." - - if type -p diff &>/dev/null; then - eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")" - else - eerror "Old checksums in: ${cksum_file}" - eerror "New checksums in: ${cksum_file}.new" - fi - - die "Header checksum mismatch, aborting." - fi - else - echo "${cksum}" > "${cksum_file}" - fi + multilib_check_headers } multilib_foreach_abi autotools-multilib_secure_install diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass index 4298a54..2b6c8b5 100644 --- a/gx86/eclass/multilib-build.eclass +++ b/gx86/eclass/multilib-build.eclass @@ -137,5 +137,43 @@ multilib_parallel_foreach_abi() { multijob_finish } +# @FUNCTION: multilib_check_headers +# @DESCRIPTION: +# Check whether the header files are consistent between ABIs. +# +# This function needs to be called after each ABI's installation phase. +# It obtains the header file checksums and compares them with previous +# runs (if any). Dies if header files differ. +multilib_check_headers() { + _multilib_header_cksum() { + find "${ED}"usr/include -type f \ + -exec cksum {} + | sort -k2 + } + + local cksum=$(_multilib_header_cksum) + local cksum_file=${T}/.multilib_header_cksum + + if [[ -f ${cksum_file} ]]; then + local cksum_prev=$(< "${cksum_file}") + + if [[ ${cksum} != ${cksum_prev} ]]; then + echo "${cksum}" > "${cksum_file}.new" + + eerror "Header files have changed between ABIs." + + if type -p diff &>/dev/null; then + eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")" + else + eerror "Old checksums in: ${cksum_file}" + eerror "New checksums in: ${cksum_file}.new" + fi + + die "Header checksum mismatch, aborting." + fi + else + echo "${cksum}" > "${cksum_file}" + fi +} + _MULTILIB_BUILD=1 fi -- 1.8.1.2