summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2011-09-16 15:37:59 +0000
committerMichał Górny <mgorny@gentoo.org>2011-09-16 15:37:59 +0000
commit58b410c9c57d348eceae03853ec2e710699a99d8 (patch)
treee207e6e7157898cb136243a49fcfd8b1681ac70f /eclass/autotools-utils.eclass
parentClean up & simplify la removal code a little. (diff)
downloadhistorical-58b410c9c57d348eceae03853ec2e710699a99d8.tar.gz
historical-58b410c9c57d348eceae03853ec2e710699a99d8.tar.bz2
historical-58b410c9c57d348eceae03853ec2e710699a99d8.zip
Check command-line args completely in remove_libtool_files().
Diffstat (limited to 'eclass/autotools-utils.eclass')
-rw-r--r--eclass/autotools-utils.eclass15
1 files changed, 13 insertions, 2 deletions
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 2b1e19401465..d0fca92d969a 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.15 2011/09/16 15:37:41 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.16 2011/09/16 15:37:59 mgorny Exp $
# @ECLASS: autotools-utils.eclass
# @MAINTAINER:
@@ -144,6 +144,17 @@ _check_build_dir() {
# See autotools-utils_src_install for reference.
remove_libtool_files() {
debug-print-function ${FUNCNAME} "$@"
+ local removing_all
+ [[ ${#} -le 1 ]] || die "Invalid number of args to ${FUNCNAME}()"
+ if [[ ${#} -eq 1 ]]; then
+ case "${1}" in
+ all)
+ removing_all=1
+ ;;
+ *)
+ die "Invalid argument to ${FUNCNAME}(): ${1}"
+ esac
+ fi
local f
find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do
@@ -154,7 +165,7 @@ remove_libtool_files() {
# Keep .la files when:
# - they have shouldnotlink=yes - likely plugins,
# - respective static archive exists.
- if [[ "$1" == 'all' || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then
+ if [[ ${removing_all} || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then
einfo "Removing unnecessary ${f#${D%/}}"
rm -f "${f}" || die
fi