summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-21 04:28:21 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-21 04:28:21 -0700
commit087d5b38e41d1b931b48ac699ba6dc81e39af3b3 (patch)
tree334b013f5c98d6d0d7bc587ccf7127d9ee3f84f5
parentf5ee0560b32349e13f21b455914e2a672879d6cc (diff)
downloadportage-087d5b38e41d1b931b48ac699ba6dc81e39af3b3.tar.gz
portage-087d5b38e41d1b931b48ac699ba6dc81e39af3b3.tar.bz2
portage-087d5b38e41d1b931b48ac699ba6dc81e39af3b3.zip
Suppress 'invalid .la file' message if necessary.
This will fix bug #340725.
-rw-r--r--pym/portage/package/ebuild/doebuild.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index eea337eb5..3c8489844 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1420,6 +1420,9 @@ def _post_src_install_uid_fix(mysettings, out):
f = open(_unicode_encode(fpath,
encoding=_encodings['merge'], errors='strict'),
mode='rb')
+ has_lafile_header = b'.la - a libtool library file' \
+ in f.readline()
+ f.seek(0)
contents = f.read()
f.close()
try:
@@ -1429,10 +1432,17 @@ def _post_src_install_uid_fix(mysettings, out):
if not fixlafiles_announced:
fixlafiles_announced = True
writemsg("Fixing .la files\n", fd=out)
+
+ # Suppress warnings if the file does not have the
+ # expected header (bug #340725). Even if the header is
+ # missing, we still call rewrite_lafile() since some
+ # valid libtool archives may not have the header.
msg = " %s is not a valid libtool archive, skipping\n" % fpath[len(destdir):]
qa_msg = "QA Notice: invalid .la file found: %s, %s" % (fpath[len(destdir):], e)
- writemsg(msg, fd=out)
- eqawarn(qa_msg, key=mysettings.mycpv, out=out)
+ if has_lafile_header:
+ writemsg(msg, fd=out)
+ eqawarn(qa_msg, key=mysettings.mycpv, out=out)
+
if needs_update:
if not fixlafiles_announced:
fixlafiles_announced = True