[oe-commits] Richard Purdie : package.bbclass: Move PKG handling code to emit_pkgdata

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


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

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Tue Jan 29 13:53:17 2013 +0000

package.bbclass: Move PKG handling code to emit_pkgdata

We only use the PKG variable in emit_pkgdata so we might as well move the
fallback code there, allowing restructuring of other parts of the metadata.

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

---

 meta/classes/package.bbclass |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 4e7db9a..858afbd 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1038,11 +1038,6 @@ python populate_packages () {
 
     bb.build.exec_func("package_name_hook", d)
 
-    for pkg in package_list:
-        pkgname = d.getVar('PKG_%s' % pkg, True)
-        if pkgname is None:
-            d.setVar('PKG_%s' % pkg, pkg)
-
     dangling_links = {}
     pkg_files = {}
     for pkg in package_list:
@@ -1154,6 +1149,11 @@ python emit_pkgdata() {
     for pkg in packages.split():
         subdata_file = pkgdatadir + "/runtime/%s" % pkg
 
+        pkgval = d.getVar('PKG_%s' % pkg, True)
+        if pkgval is None:
+            pkgval = pkg
+            d.setVar('PKG_%s' % pkg, pkg)
+
         sf = open(subdata_file, 'w')
         write_if_exists(sf, pkg, 'PN')
         write_if_exists(sf, pkg, 'PV')
@@ -1189,7 +1189,6 @@ python emit_pkgdata() {
         sf.close()
 
         # Symlinks needed for reverse lookups (from the final package name)
-        pkgval = d.getVar('PKG_%s' % (pkg), True)
         subdata_sym = pkgdatadir + "/runtime-reverse/%s" % pkgval
         oe.path.symlink("../runtime/%s" % pkg, subdata_sym, True)
 





More information about the Openembedded-commits mailing list