On Sunday 09 November 2008, Fabian Groffen wrote:
> You could identify ELF a bit more reliable by running file on e.g.
> "${ROOT}/bin/bash", or just by building a list of CHOSTs that you
> know are ELF systems.
D'oh, should have thought of that. See attached patch.
> > > > + 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}"
> > >
> > > rationale?
> >
> > "I've been told" that .la files are really only needed on non-ELF
> > systems and with plugin systems that use dlopen. I actually have no
> > way of knowing that the .la files are needed on those arches, but I
> > had your archs in mind when doing the patch.
>
> Ok. What worries me though is that this would result in some systems
> having libtool files whereas the majority does not. E.g. removing
> them apparently fixes a problem that then crops up on those systems
> or something. Can't think of any atm.
I can. If you have .la files, you will need to revdep-rebuild a lot
more. But c'est la vie.
--
/PA
--- /usr/portage/eclass/eutils.eclass 2008-09-28 07:06:15.000000000 +0200
+++ eutils1.eclass 2008-11-09 18:26:44.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 [[ "$(file ${ROOT}/bin/bash)" =~ " ELF " ]]
+ then
+ debug-print "ELF system found, proceeding..."
+ ebegin "Removing useless .la files"
+ find "${TARGET}" -name '*.la' '(' -type l -o -type f ')' -exec rm -f '{}' '+'
+ eend 0
+ else
+ debug-print "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
+}
signature.asc
Description: This is a digitally signed message part.
