Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] prune_libtool_files(): go into .a removal only when .a exists.
Date: Fri, 15 Jun 2012 13:32:17
It is a little confusing when the function reports .a removal when no
such file exists. Also, explain why the file is removed.
 eclass/eutils.eclass |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 116f7bc..931d97d 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1438,8 +1438,10 @@ prune_libtool_files() {
 		# Remove static libs we're not supposed to link against.
 		if grep -q '^shouldnotlink=yes$' "${f}"; then
-			einfo "Removing unnecessary ${archivefile#${D%/}}"
-			rm -f "${archivefile}"
+			if [[ -f ${archivefile} ]]; then
+				einfo "Removing unnecessary ${archivefile#${D%/}} (static plugin)"
+				rm -f "${archivefile}"
+			fi
 			# The .la file may be used by a module loader, so avoid removing it
 			# unless explicitly requested.