diff options
author | 2011-09-16 15:38:13 +0000 | |
---|---|---|
committer | 2011-09-16 15:38:13 +0000 | |
commit | 2722f4ffd5adfe09ccb8ebfe931727bc78efc19b (patch) | |
tree | b84c5d36e3f8a413118854121aa910c1d2e91d2b | |
parent | Check command-line args completely in remove_libtool_files(). (diff) | |
download | gentoo-2-2722f4ffd5adfe09ccb8ebfe931727bc78efc19b.tar.gz gentoo-2-2722f4ffd5adfe09ccb8ebfe931727bc78efc19b.tar.bz2 gentoo-2-2722f4ffd5adfe09ccb8ebfe931727bc78efc19b.zip |
Refactor remove_libtool_files() to simplify conditions.
-rw-r--r-- | eclass/autotools-utils.eclass | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass index d0fca92d969a..b8ab2ea9d3bb 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.16 2011/09/16 15:37:59 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.17 2011/09/16 15:38:13 mgorny Exp $ # @ECLASS: autotools-utils.eclass # @MAINTAINER: @@ -162,18 +162,20 @@ remove_libtool_files() { 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 [[ ${removing_all} || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then - einfo "Removing unnecessary ${f#${D%/}}" - rm -f "${f}" || die - fi - # Remove static libs we're not supposed to link against if [[ ${shouldnotlink} ]]; then einfo "Removing unnecessary ${archivefile#${D%/}}" rm -f "${archivefile}" || die + # We're never going to remove the .la file. + [[ ${removing_all} ]] || continue + fi + + # Keep .la files when: + # - they have shouldnotlink=yes - likely plugins (handled above), + # - respective static archive exists. + if [[ ${removing_all} || ! -f ${archivefile} ]]; then + einfo "Removing unnecessary ${f#${D%/}}" + rm -f "${f}" || die fi done } |