diff options
Diffstat (limited to 'meta/classes/prserv.bbclass')
-rw-r--r-- | meta/classes/prserv.bbclass | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/meta/classes/prserv.bbclass b/meta/classes/prserv.bbclass index 18b8589a7..0825306f9 100644 --- a/meta/classes/prserv.bbclass +++ b/meta/classes/prserv.bbclass @@ -1,29 +1,21 @@ -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": + import oe.prservice + if d.getVar('USE_PR_SERV', True) != "1": 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) + version = d.getVar("PRAUTOINX", True) + pkgarch = d.getVar("PACKAGE_ARCH", True) + checksum = d.getVar("BB_TASKHASH", True) + + if d.getVar('PRSERV_LOCKDOWN', True): + auto_rev = d.getVar('PRAUTO_' + version + '_' + pkgarch, True) or d.getVar('PRAUTO_' + version, True) or None + else: + conn = d.getVar("__PRSERV_CONN", True) if conn is None: - return None + conn = oe.prservice.prserv_make_conn(d) + if conn is None: + return None + auto_rev = conn.getPR(version, pkgarch, checksum) - 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 |