diff options
author | Constantin Musca <constantinx.musca@intel.com> | 2013-01-23 16:54:03 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-25 12:42:08 +0000 |
commit | 1db3531cd5ecded0ccf6a6fdc03b8ff4755c0c73 (patch) | |
tree | b64fe3d0731a908c3cdb56b0bf9605bb3a4b23ff /bitbake/lib | |
parent | 6930251f6c6316ee1fd9c00ff9d760dcf3e37285 (diff) | |
download | poky-1db3531cd5ecded0ccf6a6fdc03b8ff4755c0c73.tar.gz |
bitbake: prserv: use only PRSERV_HOST
- remove PRSERV_PORT variable
- use 'hostname:port' as PRSERV_HOST format
- use 'localhost:0' for enabling the local PRServer
[YOCTO #3744]
(Bitbake rev: ad62eed9e1f0867a406e9fbfa44916a0f1ad1282)
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/prserv/serv.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py index 5567c6f574..d8bdf31ba9 100644 --- a/bitbake/lib/prserv/serv.py +++ b/bitbake/lib/prserv/serv.py | |||
@@ -268,10 +268,17 @@ def is_local_special(host, port): | |||
268 | 268 | ||
269 | def auto_start(d): | 269 | def auto_start(d): |
270 | global singleton | 270 | global singleton |
271 | if (not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True)): | 271 | |
272 | host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':')) | ||
273 | if not host_params: | ||
274 | return True | ||
275 | |||
276 | if len(host_params) != 2: | ||
277 | logger.critical('\n'.join(['PRSERV_HOST: incorrect format', | ||
278 | 'Usage: PRSERV_HOST = "<hostname>:<port>"'])) | ||
272 | return True | 279 | return True |
273 | 280 | ||
274 | if is_local_special(d.getVar('PRSERV_HOST', True), int(d.getVar('PRSERV_PORT', True))) and not singleton: | 281 | if is_local_special(host_params[0], int(host_params[1])) and not singleton: |
275 | import bb.utils | 282 | import bb.utils |
276 | cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True)) | 283 | cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True)) |
277 | if not cachedir: | 284 | if not cachedir: |
@@ -285,8 +292,8 @@ def auto_start(d): | |||
285 | if singleton: | 292 | if singleton: |
286 | host, port = singleton.getinfo() | 293 | host, port = singleton.getinfo() |
287 | else: | 294 | else: |
288 | host = d.getVar('PRSERV_HOST', True) | 295 | host = host_params[0] |
289 | port = int(d.getVar('PRSERV_PORT', True)) | 296 | port = int(host_params[1]) |
290 | 297 | ||
291 | try: | 298 | try: |
292 | return PRServerConnection(host,port).ping() | 299 | return PRServerConnection(host,port).ping() |