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 B674F1384B4 for ; Sun, 6 Dec 2015 18:59:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E1C321C118; Sun, 6 Dec 2015 18:58:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4B4D221C107 for ; Sun, 6 Dec 2015 18:58:06 +0000 (UTC) Received: from localhost.localdomain (d202-251.icpnet.pl [109.173.202.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id B3CA8340686; Sun, 6 Dec 2015 18:58:03 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/9] multilib-build.eclass: Add missing error checks Date: Sun, 6 Dec 2015 19:57:47 +0100 Message-Id: <1449428274-20439-3-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449428274-20439-1-git-send-email-mgorny@gentoo.org> References: <1449428274-20439-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: ea612d05-86bc-40e5-9d7b-3bfdee4653c5 X-Archives-Hash: e3e3549e7076bcac5754fd232c915b31 --- eclass/multilib-build.eclass | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass index dd03553..8e58a2b 100644 --- a/eclass/multilib-build.eclass +++ b/eclass/multilib-build.eclass @@ -262,19 +262,23 @@ multilib_for_best_abi() { # runs (if any). Dies if header files differ. multilib_check_headers() { _multilib_header_cksum() { - [[ -d ${ED}usr/include ]] && \ - find "${ED}"usr/include -type f \ - -exec cksum {} + | sort -k2 + set -o pipefail + + if [[ -d ${ED}usr/include ]]; then + find "${ED}"usr/include -type f \ + -exec cksum {} + | sort -k2 + fi } - local cksum=$(_multilib_header_cksum) + local cksum cksum_prev local cksum_file=${T}/.multilib_header_cksum + cksum=$(_multilib_header_cksum) || die if [[ -f ${cksum_file} ]]; then - local cksum_prev=$(< "${cksum_file}") + cksum_prev=$(< "${cksum_file}") || die if [[ ${cksum} != ${cksum_prev} ]]; then - echo "${cksum}" > "${cksum_file}.new" + echo "${cksum}" > "${cksum_file}.new" || die eerror "Header files have changed between ABIs." @@ -288,7 +292,7 @@ multilib_check_headers() { die "Header checksum mismatch, aborting." fi else - echo "${cksum}" > "${cksum_file}" + echo "${cksum}" > "${cksum_file}" || die fi } @@ -409,9 +413,9 @@ multilib_prepare_wrappers() { if [[ -L ${root}/${f} ]]; then # rewrite the symlink target - local target=$(readlink "${root}/${f}") - local target_dir - local target_fn=${target##*/} + local target + target=$(readlink "${root}/${f}") || die + local target_dir target_fn=${target##*/} [[ ${target} == */* ]] && target_dir=${target%/*} @@ -453,7 +457,7 @@ multilib_prepare_wrappers() { if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then dodir "/tmp/multilib-include${dir}" # a generic template - cat > "${wrapper}" <<_EOF_ + cat > "${wrapper}" <<_EOF_ || die /* This file is auto-generated by multilib-build.eclass * as a multilib-friendly wrapper. For the original content, * please see the files that are #included below. -- 2.6.3