Patchwork [12/40] classes/package_rpm.bbclass: Change the way the PV is transformed

login
register
mail settings
Submitter Mark Hatle
Date June 22, 2011, 5:36 p.m.
Message ID <0497b42827924fa6e5cffbd1a632d3191b2cac96.1308763995.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/6327/
State New, archived
Headers show

Comments

Mark Hatle - June 22, 2011, 5:36 p.m.
There were some odd instances where the PKGV could not be loaded in the old
way.  Change to verify that PKGV exists before attempting to retrieve the
value from the key.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package_rpm.bbclass |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 9a854f3..b4bd374 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -329,10 +329,11 @@  python write_specfile () {
 				ver = depends_dict[dep]
 				if dep and ver:
 					if '-' in ver:
-						subd = oe.packagedata.read_subpkgdata_dict(dep, d)
-						pv = subd['PKGV']
-						reppv = pv.replace('-', '+')
-						ver = ver.replace(pv, reppv)
+						subd = oe.packagedata.read_subpkgdata(dep, d)
+						if 'PKGV' in subd:
+							pv = subd['PKGV']
+							reppv = pv.replace('-', '+')
+							ver = ver.replace(pv, reppv)
 				newdeps_dict[dep] = ver
 			depends = bb.utils.join_deps(newdeps_dict)
 			bb.data.setVar(varname, depends.strip(), d)