diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-12-06 16:21:00 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-12-09 21:41:16 +0100 |
commit | 0976eed9514e637b492d7afdf27e6420330da0fe (patch) | |
tree | f03455ed72babf458f05d221274762260076853c /eclass/multilib-build.eclass | |
parent | multilib-build.eclass: Mark eclass-generated variables read-only (diff) | |
download | gentoo-0976eed9514e637b492d7afdf27e6420330da0fe.tar.gz gentoo-0976eed9514e637b492d7afdf27e6420330da0fe.tar.bz2 gentoo-0976eed9514e637b492d7afdf27e6420330da0fe.zip |
multilib-build.eclass: Add missing error checks
Diffstat (limited to 'eclass/multilib-build.eclass')
-rw-r--r-- | eclass/multilib-build.eclass | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass index dd0355351e8e..8e58a2be1df5 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. |