diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-05-18 21:15:01 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-27 17:55:49 +0100 |
commit | 66d27435beb471d883355cc942f1d4489ebdad68 (patch) | |
tree | 9459738a344c66143bf4ebc6753f2cad39824c61 /meta/classes/prserv.bbclass | |
parent | f906608f68bb0640b61bb4f4986d77b6f30df0f9 (diff) | |
download | poky-66d27435beb471d883355cc942f1d4489ebdad68.tar.gz |
classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
1. Added package_get_auto_pr to PACKAGEFUNCS to get the auto
incremented value(PRAUTO) from remote PR service.
2. use PKGV/PKGR for pkgdata which will be used by package_write_xxx.
3. Added supporting functions in prserv.bbclass.
(From OE-Core rev: b1f6120c04731d3d66f322ce550b0d223c118dab)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/prserv.bbclass')
-rw-r--r-- | meta/classes/prserv.bbclass | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/classes/prserv.bbclass b/meta/classes/prserv.bbclass new file mode 100644 index 0000000000..de46ff6897 --- /dev/null +++ b/meta/classes/prserv.bbclass | |||
@@ -0,0 +1,29 @@ | |||
1 | def prserv_make_conn(d): | ||
2 | import prserv.serv | ||
3 | host=d.getVar("PRSERV_HOST",True) | ||
4 | port=d.getVar("PRSERV_PORT",True) | ||
5 | try: | ||
6 | conn=None | ||
7 | conn=prserv.serv.PRServerConnection(host,int(port)) | ||
8 | d.setVar("__PRSERV_CONN",conn) | ||
9 | except Exception, exc: | ||
10 | bb.fatal("Connecting to PR service %s:%s failed: %s" % (host, port, str(exc))) | ||
11 | |||
12 | return conn | ||
13 | |||
14 | def prserv_get_pr_auto(d): | ||
15 | if not d.getVar('USE_PR_SERV', True): | ||
16 | bb.warn("Not using network based PR service") | ||
17 | return None | ||
18 | |||
19 | conn=d.getVar("__PRSERV_CONN", True) | ||
20 | if conn is None: | ||
21 | conn=prserv_make_conn(d) | ||
22 | if conn is None: | ||
23 | return None | ||
24 | |||
25 | version=d.getVar("PF", True) | ||
26 | checksum=d.getVar("BB_TASKHASH", True) | ||
27 | auto_rev=conn.getPR(version,checksum) | ||
28 | bb.debug(1,"prserv_get_pr_auto: version: %s checksum: %s result %d" % (version, checksum, auto_rev)) | ||
29 | return auto_rev | ||