From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KzCnH-0000Cg-5Z for garchives@archives.gentoo.org; Sun, 09 Nov 2008 16:05:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9AC8FE014B; Sun, 9 Nov 2008 16:05:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6F62AE014B for ; Sun, 9 Nov 2008 16:05:42 +0000 (UTC) Received: from 0x3ef266d2.svgnxx4.dynamic.dsl.tele.dk (0x3ef266d2.svgnxx4.dynamic.dsl.tele.dk [62.242.102.210]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 59EE6653F4 for ; Sun, 9 Nov 2008 16:05:40 +0000 (UTC) From: Peter Alfredsen To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] Please review: function epunt_la_files for eutils.eclass Date: Sun, 9 Nov 2008 18:04:05 +0200 User-Agent: KMail/1.9.10 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 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1807332.M5ffuMJ2B3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200811091704.10291.loki_val@gentoo.org> X-Archives-Salt: 8e4a8a47-a37a-4449-8b74-0f8495073136 X-Archives-Hash: d73df9e95bc360ca934ebc8e8d9f7e12 --nextPart1807332.M5ffuMJ2B3 Content-Type: multipart/mixed; boundary="Boundary-01=_1nwFJ0Tgy53JatD" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_1nwFJ0Tgy53JatD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I attach here a proposed new function for eutils.eclass. Review=20 requested. Thanks to zlin and igli for initial review and suggestions=20 on #gentoo-dev-help. =2D-=20 /PA --Boundary-01=_1nwFJ0Tgy53JatD Content-Type: text/x-diff; charset="utf-8"; name="eutils.eclass.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="eutils.eclass.patch" --- /usr/portage/eclass/eutils.eclass 2008-09-28 07:06:15.000000000 +0200 +++ eutils1.eclass 2008-11-06 22:22:51.000000000 +0100 @@ -1805,5 +1805,37 @@ ) || die else newbin "${tmpwrapper}" "${wrapper}" || die fi } + +# @FUNCTION: epunt_la_files +# @USAGE: [dir to scan] +# @DESCRIPTION: +# .la files can cause many unpleasantries when they disappear, +# forcing rebuilds of seemingly unrelated packages. +# This function removes the .la files from [dir to scan], "${D}" if not set. +# A good time to start punting .la files may be when a .so bump happens, +# so dependent packages do not have to be rebuilt twice. +# +# See also: +# bug 245889 +# http://blog.flameeyes.eu/2008/07/02/again-about-la-files-or-why-should-they-be-killed-off-sooner-rather-than-later + +epunt_la_files() { + debug-print-function $FUNCNAME "$@" + local TARGET=$1 + [ -z "${TARGET}" ] && TARGET="${D}" + + # If this is a non-ELF system, chances are good that the .la files will be needed. + if type -P scanelf &> /dev/null + then + debug-print "Scanelf found, proceeding..." + ebegin "Removing useless .la files" + find "${TARGET}" -name '*.la' '(' -type l -o -type f ')' -exec rm -f '{}' '+' + eend 0 + else + debug-print "scanelf not found, this appears to be a non-ELF system." + debug-print "non-ELF systems are likely to need .la files." + debug-print ".la files not removed from ${TARGET}" + fi +} --Boundary-01=_1nwFJ0Tgy53JatD-- --nextPart1807332.M5ffuMJ2B3 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAkkXCfoACgkQtEGUx4TfHiQ2AwCeL0Y9Z5UUs7xeagdIN+wwEBIq SPIAoIPK0hiiR+cc0TZSLNagwwInNnTx =Ss/2 -----END PGP SIGNATURE----- --nextPart1807332.M5ffuMJ2B3--