diff options
author | Michał Górny <mgorny@gentoo.org> | 2011-09-16 15:37:41 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2011-09-16 15:37:41 +0000 |
commit | b01ddd81418ae59473989aa8863a0a3b60be42e4 (patch) | |
tree | 53f59ae68a4a754860fb2b8499976b9f1a2db48e /eclass | |
parent | For .la removal, look for static archives rather than USE=static-libs. (diff) | |
download | gentoo-2-b01ddd81418ae59473989aa8863a0a3b60be42e4.tar.gz gentoo-2-b01ddd81418ae59473989aa8863a0a3b60be42e4.tar.bz2 gentoo-2-b01ddd81418ae59473989aa8863a0a3b60be42e4.zip |
Clean up & simplify la removal code a little.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/autotools-utils.eclass | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass index 9b65eab2b6ea..2b1e19401465 100644 --- a/eclass/autotools-utils.eclass +++ b/eclass/autotools-utils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.14 2011/09/16 15:33:19 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.15 2011/09/16 15:37:41 mgorny Exp $ # @ECLASS: autotools-utils.eclass # @MAINTAINER: @@ -149,21 +149,20 @@ remove_libtool_files() { find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}") local archivefile=${f/%.la/.a} + [[ "${f}" != "${archivefile}" ]] || die 'regex sanity check failed' # Keep .la files when: # - they have shouldnotlink=yes - likely plugins, # - respective static archive exists. if [[ "$1" == 'all' || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then einfo "Removing unnecessary ${f#${D%/}}" - rm -f "${f}" + rm -f "${f}" || die fi # Remove static libs we're not supposed to link against - if [[ -n ${shouldnotlink} ]]; then - local remove=${f/%.la/.a} - [[ "${f}" != "${remove}" ]] || die 'regex sanity check failed' - einfo "Removing unnecessary ${remove#${D%/}}" - rm -f "${remove}" + if [[ ${shouldnotlink} ]]; then + einfo "Removing unnecessary ${archivefile#${D%/}}" + rm -f "${archivefile}" || die fi done } |