Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [RFC][PATCH 2/4] package.bbclass: show warning when package is trying to provide already provided shlib
Date: Sun,  7 Jul 2013 01:13:05 +0200	[thread overview]
Message-ID: <1373152387-19393-2-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <1373152387-19393-1-git-send-email-Martin.Jansa@gmail.com>

* move read_shlib_providers before registering package as provider
  and don't change provider if it already exists, show warning instead

[YOCTO #4628]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/package.bbclass | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index d80535d..6c3ca56 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1341,6 +1341,7 @@ python package_do_shlibs() {
         list_re = re.compile('^(.*)\.list$')
         # Go from least to most specific since the last one found wins
         for dir in reversed(shlibs_dirs):
+            bb.debug(2, "Reading shlib providers in %s" % (dir))
             if not os.path.exists(dir):
                 continue
             for file in os.listdir(dir):
@@ -1456,6 +1457,8 @@ python package_do_shlibs() {
 
     needed = {}
     shlib_provider = {}
+    read_shlib_providers()
+
     for pkg in packages.split():
         private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True)
         needs_ldconfig = False
@@ -1487,6 +1490,12 @@ python package_do_shlibs() {
         if len(sonames):
             fd = open(shlibs_file, 'w')
             for s in sonames:
+                if s in shlib_provider:
+                    (old_pkg, old_pkgver) = shlib_provider[s]
+                    if old_pkg != pkg:
+                        bb.warn('%s-%s is already registered as shlib provider for %s, ignoring %s-%s trying to register the same' % (old_pkg, old_pkgver, s, pkg, pkgver))
+                        continue
+                bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s))
                 fd.write(s + '\n')
                 shlib_provider[s] = (pkg, pkgver)
             fd.close()
@@ -1501,8 +1510,6 @@ python package_do_shlibs() {
             postinst += d.getVar('ldconfig_postinst_fragment', True)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-    read_shlib_providers()
-
     bb.utils.unlockfile(lf)
 
     assumed_libs = d.getVar('ASSUME_SHLIBS', True)
-- 
1.8.2.1



  reply	other threads:[~2013-07-06 23:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06 23:13 [RFC][PATCH 1/4] package.bbclass: move reading shlibs providers to separate function Martin Jansa
2013-07-06 23:13 ` Martin Jansa [this message]
2013-07-10 11:51   ` [RFC][PATCH 2/4] package.bbclass: show warning when package is trying to provide already provided shlib Martin Jansa
2013-07-06 23:13 ` [RFC][PATCH 3/4] package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers Martin Jansa
2013-09-02 11:22   ` Richard Purdie
2013-09-02 11:27     ` Martin Jansa
2013-07-06 23:13 ` [RFC][PATCH 4/4] WIP: package.bbclass: add some pseudo-code to filter shlibs providers based on dependencies Martin Jansa
2013-08-28  8:33 ` [RFC][PATCH 1/4] package.bbclass: move reading shlibs providers to separate function Martin Jansa
2013-09-02 11:19   ` Richard Purdie
2013-09-05 11:40   ` Richard Purdie
2013-09-05 12:01     ` Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373152387-19393-2-git-send-email-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox