Patchwork [PRService/meta,2/3] package.bbclass: per recipe PRSERV_HOST support

login
register
mail settings
Submitter Lianhao Lu
Date Dec. 30, 2011, 3:50 a.m.
Message ID <50cb9121e9ded46657e7466d192029eb88a1d6d9.1325215668.git.lianhao.lu@intel.com>
Download mbox | patch
Permalink /patch/17827/
State New
Headers show

Comments

Lianhao Lu - Dec. 30, 2011, 3:50 a.m.
[YOCTO #1126]
Added per recipe PRSERV_HOST PRSERV_PORT support.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/package.bbclass |   10 +++++++++-
 meta/conf/bitbake.conf       |    2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 07d6f9a..4fb7cc1 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -350,6 +350,14 @@  def runtime_mapping_rename (varname, d):
 #
 
 python package_get_auto_pr() {
+	# per recipe PRSERV_HOST PRSERV_PORT
+	pn = d.getVar('PN', True)
+	host = d.getVar("PRSERV_HOST_" + pn, True)
+	port = d.getVar("PRSERV_PORT_" + pn, True)
+	if not (host is None):
+		d.setVar("PRSERV_HOST", host)
+	if not (port is None):
+		d.setVar("PRSERV_PORT", port)
 	if d.getVar('USE_PR_SERV', True) != "0":
 		try:
 			auto_pr=prserv_get_pr_auto(d)
@@ -362,7 +370,7 @@  python package_get_auto_pr() {
 				bb.error("Can NOT get auto PRAUTO from lockdown exported file")
 			else:
 				bb.error("Can NOT get auto PRAUTO from remote PR service")
-			raise bb.build.FuncFailed(e)
+			raise bb.build.FuncFailed()
 			return 
 		d.setVar('PRAUTO',str(auto_pr))
 }
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 31a722e..6b1744f 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -190,7 +190,7 @@  BP = "${BPN}-${PV}"
 #
 # network based PR service
 #
-USE_PR_SERV = "${@[1,0][((d.getVar('PRSERV_HOST',1) is None) or (d.getVar('PRSERV_PORT',1) is None)) and (d.getVar('PRSERV_LOCKDOWN',1) is None)]}"
+USE_PR_SERV = "${@[1,0][((d.getVar('PRSERV_HOST',1) is None) or (d.getVar('PRSERV_HOST',1) == "") or (d.getVar('PRSERV_PORT',1) is None) or (d.getVar('PRSERV_PORT',1) == "")) and (d.getVar('PRSERV_LOCKDOWN',1) is None)]}"
 
 # Package info.