summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/prservice.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/prservice.py')
-rw-r--r--meta/lib/oe/prservice.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index 0054f954cc..32dfc15e88 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -1,7 +1,7 @@
1 1
2def prserv_make_conn(d, check = False): 2def prserv_make_conn(d, check = False):
3 import prserv.serv 3 import prserv.serv
4 host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f]) 4 host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
5 try: 5 try:
6 conn = None 6 conn = None
7 conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1])) 7 conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
@@ -15,11 +15,11 @@ def prserv_make_conn(d, check = False):
15 return conn 15 return conn
16 16
17def prserv_dump_db(d): 17def prserv_dump_db(d):
18 if not d.getVar('PRSERV_HOST', True): 18 if not d.getVar('PRSERV_HOST'):
19 bb.error("Not using network based PR service") 19 bb.error("Not using network based PR service")
20 return None 20 return None
21 21
22 conn = d.getVar("__PRSERV_CONN", True) 22 conn = d.getVar("__PRSERV_CONN")
23 if conn is None: 23 if conn is None:
24 conn = prserv_make_conn(d) 24 conn = prserv_make_conn(d)
25 if conn is None: 25 if conn is None:
@@ -27,18 +27,18 @@ def prserv_dump_db(d):
27 return None 27 return None
28 28
29 #dump db 29 #dump db
30 opt_version = d.getVar('PRSERV_DUMPOPT_VERSION', True) 30 opt_version = d.getVar('PRSERV_DUMPOPT_VERSION')
31 opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH', True) 31 opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH')
32 opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM', True) 32 opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM')
33 opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL', True)) 33 opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL'))
34 return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col) 34 return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
35 35
36def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None): 36def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
37 if not d.getVar('PRSERV_HOST', True): 37 if not d.getVar('PRSERV_HOST'):
38 bb.error("Not using network based PR service") 38 bb.error("Not using network based PR service")
39 return None 39 return None
40 40
41 conn = d.getVar("__PRSERV_CONN", True) 41 conn = d.getVar("__PRSERV_CONN")
42 if conn is None: 42 if conn is None:
43 conn = prserv_make_conn(d) 43 conn = prserv_make_conn(d)
44 if conn is None: 44 if conn is None:
@@ -58,7 +58,7 @@ def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksu
58 (filter_checksum and filter_checksum != checksum): 58 (filter_checksum and filter_checksum != checksum):
59 continue 59 continue
60 try: 60 try:
61 value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum, True)) 61 value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum))
62 except BaseException as exc: 62 except BaseException as exc:
63 bb.debug("Not valid value of %s:%s" % (v,str(exc))) 63 bb.debug("Not valid value of %s:%s" % (v,str(exc)))
64 continue 64 continue
@@ -72,8 +72,8 @@ def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksu
72def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False): 72def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
73 import bb.utils 73 import bb.utils
74 #initilize the output file 74 #initilize the output file
75 bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR', True)) 75 bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR'))
76 df = d.getVar('PRSERV_DUMPFILE', True) 76 df = d.getVar('PRSERV_DUMPFILE')
77 #write data 77 #write data
78 lf = bb.utils.lockfile("%s.lock" % df) 78 lf = bb.utils.lockfile("%s.lock" % df)
79 f = open(df, "a") 79 f = open(df, "a")
@@ -114,7 +114,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
114 bb.utils.unlockfile(lf) 114 bb.utils.unlockfile(lf)
115 115
116def prserv_check_avail(d): 116def prserv_check_avail(d):
117 host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f]) 117 host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
118 try: 118 try:
119 if len(host_params) != 2: 119 if len(host_params) != 2:
120 raise TypeError 120 raise TypeError