diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-02-10 11:44:00 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-02-10 11:44:00 +0000 |
commit | 16859fed08dc269cb1be6e2bf42ffda50c55d0ac (patch) | |
tree | d99e122fa17515dfc568822bae1392720ba2ec66 /eclass | |
parent | QA-warn if epunt_cxx does not find any checks to punt. (diff) | |
download | historical-16859fed08dc269cb1be6e2bf42ffda50c55d0ac.tar.gz historical-16859fed08dc269cb1be6e2bf42ffda50c55d0ac.tar.bz2 historical-16859fed08dc269cb1be6e2bf42ffda50c55d0ac.zip |
Move header checking function into multilib-build for wider reuse.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/autotools-multilib.eclass | 31 | ||||
-rw-r--r-- | eclass/multilib-build.eclass | 40 |
3 files changed, 46 insertions, 31 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 9f41c51a6637..b99adbe81491 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.670 2013/02/10 11:42:48 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.671 2013/02/10 11:44:00 mgorny Exp $ + + 10 Feb 2013; Michał Górny <mgorny@gentoo.org> autotools-multilib.eclass, + multilib-build.eclass: + Move header checking function into multilib-build for wider reuse. 10 Feb 2013; Michał Górny <mgorny@gentoo.org> eutils.eclass: QA-warn if epunt_cxx does not find any checks to punt. diff --git a/eclass/autotools-multilib.eclass b/eclass/autotools-multilib.eclass index 97abfe65e0ed..b2b7d02ba9e5 100644 --- a/eclass/autotools-multilib.eclass +++ b/eclass/autotools-multilib.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.8 2013/02/01 21:39:50 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.9 2013/02/10 11:44:00 mgorny Exp $ # @ECLASS: autotools-multilib.eclass # @MAINTAINER: @@ -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/eclass/multilib-build.eclass b/eclass/multilib-build.eclass index 4298a541b7bc..feac748f8210 100644 --- a/eclass/multilib-build.eclass +++ b/eclass/multilib-build.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.1 2013/02/01 21:39:50 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.2 2013/02/10 11:44:00 mgorny Exp $ # @ECLASS: multilib-build.eclass # @MAINTAINER: @@ -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 |