[oe-commits] Richard Purdie : package.bbclass: Improve package_fixsymlinks

git at git.openembedded.org git at git.openembedded.org
Wed Jan 30 17:51:34 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 38fe4ae6140fcf0db9292195e7fff6d6a7746e69
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=38fe4ae6140fcf0db9292195e7fff6d6a7746e69

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Tue Jan 29 14:02:56 2013 +0000

package.bbclass: Improve package_fixsymlinks

Improve package_fixsymlinks so we don't handle RDEPENDS for every single package
in PACKAGES.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package.bbclass |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2f1695b..1ccac9c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1064,24 +1064,29 @@ python package_fixsymlinks () {
                         target = os.path.join(root[len(inst_root):], target)
                     dangling_links[pkg].append(os.path.normpath(target))
 
-    for pkg in packages:
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "")
-
+    newrdepends = {}
+    for pkg in dangling_links:
         for l in dangling_links[pkg]:
             found = False
             bb.debug(1, "%s contains dangling link %s" % (pkg, l))
             for p in packages:
-                for f in pkg_files[p]:
-                    if f == l:
+                if l in pkg_files[p]:
                         found = True
                         bb.debug(1, "target found in %s" % p)
                         if p == pkg:
                             break
-                        if p not in rdepends:
-                            rdepends[p] = []
+                        if pkg not in newrdepends:
+                            newrdepends[pkg] = []
+                        newrdepends[pkg].append(p)
                         break
             if found == False:
                 bb.note("%s contains dangling symlink to %s" % (pkg, l))
+
+    for pkg in newrdepends:
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "")
+        for p in newrdepends[pkg]:
+            if p not in rdepends:
+                rdepends[p] = []
         d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
 }
 





More information about the Openembedded-commits mailing list