From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R3TjO-0003PL-EB for garchives@archives.gentoo.org; Tue, 13 Sep 2011 14:12:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CC2921C0EC; Tue, 13 Sep 2011 14:11:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C296121C0C3 for ; Tue, 13 Sep 2011 14:08:55 +0000 (UTC) Received: from localhost.localdomain (77-255-22-60.adsl.inetia.pl [77.255.22.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 423351B401B; Tue, 13 Sep 2011 14:08:54 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: reavertm@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH autotools-utils 4/9] Clean up & simplify la removal code a little. Date: Tue, 13 Sep 2011 16:10:28 +0200 Message-Id: <1315923033-23397-4-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1315923033-23397-1-git-send-email-mgorny@gentoo.org> References: <1315857465-8179-1-git-send-email-mgorny@gentoo.org> <1315923033-23397-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: X-Archives-Hash: 3885c84ff0d1fa04a94803b90d321fa5 --- eclass/autotools-utils.eclass | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass index ab8650f..fd644bb 100644 --- a/eclass/autotools-utils.eclass +++ b/eclass/autotools-utils.eclass @@ -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 } -- 1.7.6.1