summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2013-01-23 16:54:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-25 12:35:47 +0000
commite00f49de8b1f79c3e07b887d257bd75a46052fa0 (patch)
treeb9bad731f4747a7f6b2472567c08dd8a75d9c210 /meta
parentd8c0ce5a4a27c8aa1d07fc15d6e000af725a51e6 (diff)
downloadopenembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.tar.gz
openembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.tar.bz2
openembedded-core-e00f49de8b1f79c3e07b887d257bd75a46052fa0.zip
prserv: change PRSERV_HOST semantics
- remove PRSERV_PORT variable - use 'hostname:port' as PRSERV_HOST format - remove USE_PR_SERV variable - one can activate PRS by setting PRSERV_HOST [YOCTO #3744] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass8
-rw-r--r--meta/classes/prserv.bbclass2
-rw-r--r--meta/conf/bitbake.conf7
-rw-r--r--meta/lib/oe/prservice.py18
4 files changed, 13 insertions, 22 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 8e07168be3..60d3df7789 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -396,15 +396,13 @@ def runtime_mapping_rename (varname, d):
#
python package_get_auto_pr() {
- # per recipe PRSERV_HOST PRSERV_PORT
+ # per recipe PRSERV_HOST
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":
+
+ if d.getVar('PRSERV_HOST', True):
try:
auto_pr=prserv_get_pr_auto(d)
except Exception as e:
diff --git a/meta/classes/prserv.bbclass b/meta/classes/prserv.bbclass
index 33547f989c..b440d863ef 100644
--- a/meta/classes/prserv.bbclass
+++ b/meta/classes/prserv.bbclass
@@ -3,7 +3,7 @@ def prserv_get_pr_auto(d):
import re
pv = d.getVar("PV", True)
- if d.getVar('USE_PR_SERV', True) != "1":
+ if not d.getVar('PRSERV_HOST', True):
if 'AUTOINC' in pv:
d.setVar("PKGV", pv.replace("AUTOINC", "0"))
bb.warn("Not using network based PR service")
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 13a3ff9a3d..b6ab5c3cb1 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -207,11 +207,6 @@ SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-cana
BPN = "${@base_prune_suffix(d.getVar('PN', True), d.getVar('SPECIAL_PKGSUFFIX', True).split(), d)}"
BP = "${BPN}-${PV}"
-#
-# network based PR service
-#
-USE_PR_SERV = "${@[1,0][((not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True))) and (not d.getVar('PRSERV_LOCKDOWN', True))]}"
-
# Package info.
SECTION = "base"
@@ -778,7 +773,7 @@ BB_SIGNATURE_HANDLER ?= "OEBasicHash"
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
- PRSERV_PORT PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
+ PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE"
BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SESSION_MANAGER \
DBUS_SESSION_BUS_ADDRESS SSH_AGENT_PID XDG_SESSION_COOKIE SSH_AUTH_SOCK \
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index c3fb76a338..57fb39a371 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -1,11 +1,10 @@
def prserv_make_conn(d, check = False):
import prserv.serv
- host = d.getVar("PRSERV_HOST",True)
- port = d.getVar("PRSERV_PORT",True)
+ host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
try:
conn = None
- conn = prserv.serv.PRServerConnection(host,int(port))
+ conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
if check:
if not conn.ping():
raise Exception('service not available')
@@ -16,7 +15,7 @@ def prserv_make_conn(d, check = False):
return conn
def prserv_dump_db(d):
- if d.getVar('USE_PR_SERV', True) != "1":
+ if not d.getVar('PRSERV_HOST', True):
bb.error("Not using network based PR service")
return None
@@ -35,7 +34,7 @@ def prserv_dump_db(d):
return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
- if d.getVar('USE_PR_SERV', True) != "1":
+ if not d.getVar('PRSERV_HOST', True):
bb.error("Not using network based PR service")
return None
@@ -115,14 +114,13 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
bb.utils.unlockfile(lf)
def prserv_check_avail(d):
- host = d.getVar("PRSERV_HOST",True)
- port = d.getVar("PRSERV_PORT",True)
+ host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
try:
- if not host:
+ if len(host_params) != 2:
raise TypeError
else:
- port = int(port)
+ int(host_params[1])
except TypeError:
- bb.fatal("Undefined or incorrect values of PRSERV_HOST or PRSERV_PORT")
+ bb.fatal('Undefined/incorrect PRSERV_HOST value. Format: "host:port"')
else:
prserv_make_conn(d, True)