public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Please review: function epunt_la_files for eutils.eclass
@ 2008-11-09 16:04 Peter Alfredsen
  2008-11-09 16:10 ` Fabian Groffen
  0 siblings, 1 reply; 32+ messages in thread
From: Peter Alfredsen @ 2008-11-09 16:04 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 170 bytes --]

I attach here a proposed new function for eutils.eclass. Review 
requested. Thanks to zlin and igli for initial review and suggestions 
on #gentoo-dev-help.
-- 
/PA

[-- Attachment #1.2: eutils.eclass.patch --]
[-- Type: text/x-diff, Size: 1398 bytes --]

--- /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
+}

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2008-11-17 19:23 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-09 16:04 [gentoo-dev] Please review: function epunt_la_files for eutils.eclass Peter Alfredsen
2008-11-09 16:10 ` Fabian Groffen
2008-11-09 16:34   ` Peter Alfredsen
2008-11-09 16:48     ` Fabian Groffen
2008-11-09 17:46       ` Peter Alfredsen
2008-11-09 17:53         ` Fabian Groffen
2008-11-12 13:41     ` Mart Raudsepp
2008-11-12 14:40       ` Peter Alfredsen
2008-11-12 16:14         ` Rémi Cardona
2008-11-12 17:16           ` Peter Alfredsen
2008-11-13  6:21             ` Donnie Berkholz
2008-11-14 10:35             ` Gilles Dartiguelongue
2008-11-14 17:28               ` Marius Mauch
2008-11-14 14:25             ` Alexis Ballier
2008-11-14 14:35               ` Rémi Cardona
2008-11-16  8:44                 ` Michael Haubenwallner
2008-11-16 22:21                   ` Rémi Cardona
2008-11-14 22:31               ` Donnie Berkholz
2008-11-14 22:33                 ` Ciaran McCreesh
2008-11-14 22:44               ` David Leverton
2008-11-12 16:53         ` Mart Raudsepp
2008-11-12 17:31           ` Peter Alfredsen
2008-11-13 18:49             ` [gentoo-dev] " Ryan Hill
2008-11-14  4:14             ` Ryan Hill
2008-11-14 23:05               ` Peter Alfredsen
2008-11-14 23:25                 ` Ciaran McCreesh
2008-11-15  0:26                 ` Mart Raudsepp
2008-11-15  6:44                   ` Duncan
2008-11-17 19:19                 ` [gentoo-dev] " Steve Long
2008-11-12 15:52     ` [gentoo-dev] " Donnie Berkholz
2008-11-12 16:24       ` Peter Alfredsen
2008-11-13  6:23         ` Donnie Berkholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox