mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 00:49:33 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
6930251f6c
commit
1db3531cd5
@@ -268,10 +268,17 @@ def is_local_special(host, port):
|
|||||||
|
|
||||||
def auto_start(d):
|
def auto_start(d):
|
||||||
global singleton
|
global singleton
|
||||||
if (not d.getVar('PRSERV_HOST', True)) or (not d.getVar('PRSERV_PORT', True)):
|
|
||||||
|
host_params = filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':'))
|
||||||
|
if not host_params:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if is_local_special(d.getVar('PRSERV_HOST', True), int(d.getVar('PRSERV_PORT', True))) and not singleton:
|
if len(host_params) != 2:
|
||||||
|
logger.critical('\n'.join(['PRSERV_HOST: incorrect format',
|
||||||
|
'Usage: PRSERV_HOST = "<hostname>:<port>"']))
|
||||||
|
return True
|
||||||
|
|
||||||
|
if is_local_special(host_params[0], int(host_params[1])) and not singleton:
|
||||||
import bb.utils
|
import bb.utils
|
||||||
cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
|
cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
|
||||||
if not cachedir:
|
if not cachedir:
|
||||||
@@ -285,8 +292,8 @@ def auto_start(d):
|
|||||||
if singleton:
|
if singleton:
|
||||||
host, port = singleton.getinfo()
|
host, port = singleton.getinfo()
|
||||||
else:
|
else:
|
||||||
host = d.getVar('PRSERV_HOST', True)
|
host = host_params[0]
|
||||||
port = int(d.getVar('PRSERV_PORT', True))
|
port = int(host_params[1])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return PRServerConnection(host,port).ping()
|
return PRServerConnection(host,port).ping()
|
||||||
|
|||||||
Reference in New Issue
Block a user