poky/meta/classes/prserv.bbclass
Khem Raj c412674cf8 package.bbclass,prserv.bbclass: Compare USE_PR_SERV with "1" or "0"
Value of USE_PR_SERV is either "1" or "0" looking at
settings in bitbake.conf
USE_PR_SERV = "${@[1,0][(bb.data.getVar('PRSERV_HOST',d,1) is None) or (bb.data.getVar('PRSERV_PORT',d,1) is None)]}"
So we compare the strings

(From OE-Core rev: 5f6179324ac3956ad87123005bfcab4e8f30e67b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-29 09:40:04 +01:00

30 lines
917 B
Plaintext

def prserv_make_conn(d):
import prserv.serv
host=d.getVar("PRSERV_HOST",True)
port=d.getVar("PRSERV_PORT",True)
try:
conn=None
conn=prserv.serv.PRServerConnection(host,int(port))
d.setVar("__PRSERV_CONN",conn)
except Exception, exc:
bb.fatal("Connecting to PR service %s:%s failed: %s" % (host, port, str(exc)))
return conn
def prserv_get_pr_auto(d):
if d.getVar('USE_PR_SERV', True) != "0":
bb.warn("Not using network based PR service")
return None
conn=d.getVar("__PRSERV_CONN", True)
if conn is None:
conn=prserv_make_conn(d)
if conn is None:
return None
version=d.getVar("PF", True)
checksum=d.getVar("BB_TASKHASH", True)
auto_rev=conn.getPR(version,checksum)
bb.debug(1,"prserv_get_pr_auto: version: %s checksum: %s result %d" % (version, checksum, auto_rev))
return auto_rev