[oe] [PATCH 35/70] package_rpm.bbclass: Fix empty package handling, handle package dependency renaming by adding a missing function call and expand RPMBUILD before changing the dictonary so local PV/PR changes don't break the WORKDIR variable expansion (from Poky)
Marcin Juszkiewicz
openembedded at haerwu.biz
Wed Mar 4 15:52:50 UTC 2009
From: Richard Purdie <richard at openedhand.com>
git-svn-id: https://svn.o-hand.com/repos/poky@5100 311d38ba-8fff-0310-9ca6-ca027cbcb966
---
classes/package_rpm.bbclass | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass
index 7c69063..0b93266 100644
--- a/classes/package_rpm.bbclass
+++ b/classes/package_rpm.bbclass
@@ -43,7 +43,7 @@ python write_specfile() {
del files[files.index(r)]
except ValueError:
pass
- if not files:
+ if not files and bb.data.getVar('ALLOW_EMPTY', d) != "1":
from bb import note
note("Not creating empty archive for %s" % (bb.data.expand('${PKG}-${PV}-${PR}${DISTRO_PR}', d, True))
return
@@ -62,10 +62,11 @@ python write_specfile() {
if out_vartranslate[var][0] == "%":
continue
val = bb.data.getVar(var, d, 1)
- if var == "RDEPENDS":
- val = val.split()[0]
fd.write("%s\t: %s\n" % (out_vartranslate[var], val))
- rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True)))
+
+ bb.build.exec_func("mapping_rename_hook", d)
+ rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True) or ""))
+
if rdepends:
fd.write("Requires: %s\n" % rdepends)
fd.write("Release\t: %s\n" % bb.data.expand('${PR}${DISTRO_PR}', d, True)
@@ -158,6 +159,9 @@ python do_package_rpm () {
pkgoutdir = outdir
bb.mkdirhier(pkgoutdir)
bb.data.setVar('OUTSPECFILE', os.path.join(workdir, "%s.spec" % pkg), localdata)
+ # Save the value of RPMBUILD expanded into the new dictonary so any
+ # changes in the compoents that make up workdir don't break packaging
+ bb.data.setVar('RPMBUILD', bb.data.getVar("RPMBUILD", d, True), localdata)
bb.build.exec_func('write_specfile', localdata)
bb.utils.unlockfile(lf)
}
--
1.6.1.3
More information about the Openembedded-devel
mailing list