summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2012-01-10 14:13:49 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-11 10:36:20 +0000
commit30a9bc6c92a8920d6e9c4a4b93b83bdbe5d48e78 (patch)
tree6cce4db7619f35e16cdab7961ef44adfdd859b9e /bitbake/bin
parent4a8a3c503fd896593b787c26edbe46a7324e494e (diff)
downloadpoky-30a9bc6c92a8920d6e9c4a4b93b83bdbe5d48e78.tar.gz
bitbake/PRservice: Added no_hist mode and export/import.
[YOCTO #1556] 1. Added the package_arch into the index to the DB table. Because the change in PACKAGE_ARCH will results in different checksum, and it is better to have seperate PR value domains for differnt PACKAGE_ARCH of the same pakcage. 2. Changed the PR service to operate in no history mode. In this mode, the for a given query tuple (version, pkgarch, checksum), the returned value will be the largest among all the values of the same (version, pkgarch). This means the PR value returned can NOT be decremented. 3. Added export function. For each (version, pkgarch) tuple, only the record with the maximum value will be exported. 4. Added import function. The record will only be imported if the imported value is larger than the value stored in the DB with the same (version, pkgarch, checksum) tuple. (Bitbake rev: 379567ee879dcdc09a51f7f1212bde1076147a6f) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rw-r--r--bitbake/bin/bitbake-prserv23
1 files changed, 13 insertions, 10 deletions
diff --git a/bitbake/bin/bitbake-prserv b/bitbake/bin/bitbake-prserv
index 14073caf38..a7ab55f736 100644
--- a/bitbake/bin/bitbake-prserv
+++ b/bitbake/bin/bitbake-prserv
@@ -16,31 +16,34 @@ PRPORT_DEFAULT=8585
16def main(): 16def main():
17 parser = optparse.OptionParser( 17 parser = optparse.OptionParser(
18 version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__), 18 version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
19 usage = "%prog [options]") 19 usage = "%prog < --start | --stop > [options]")
20 20
21 parser.add_option("-f", "--file", help="database filename(default prserv.db)", action="store", 21 parser.add_option("-f", "--file", help="database filename(default: prserv.db)", action="store",
22 dest="dbfile", type="string", default="prserv.db") 22 dest="dbfile", type="string", default="prserv.db")
23 parser.add_option("-l", "--log", help="log filename(default prserv.log)", action="store", 23 parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store",
24 dest="logfile", type="string", default="prserv.log") 24 dest="logfile", type="string", default="prserv.log")
25 parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG", 25 parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
26 action = "store", type="string", dest="loglevel", default = "WARNING") 26 action = "store", type="string", dest="loglevel", default = "INFO")
27 parser.add_option("--start", help="start daemon", 27 parser.add_option("--start", help="start daemon",
28 action="store_true", dest="start", default="True") 28 action="store_true", dest="start")
29 parser.add_option("--stop", help="stop daemon", 29 parser.add_option("--stop", help="stop daemon",
30 action="store_false", dest="start") 30 action="store_true", dest="stop")
31 parser.add_option("--host", help="ip address to bind", action="store", 31 parser.add_option("--host", help="ip address to bind", action="store",
32 dest="host", type="string", default=PRHOST_DEFAULT) 32 dest="host", type="string", default=PRHOST_DEFAULT)
33 parser.add_option("--port", help="port number(default 8585)", action="store", 33 parser.add_option("--port", help="port number(default: 8585)", action="store",
34 dest="port", type="int", default=PRPORT_DEFAULT) 34 dest="port", type="int", default=PRPORT_DEFAULT)
35 35
36 options, args = parser.parse_args(sys.argv) 36 options, args = parser.parse_args(sys.argv)
37
38 prserv.init_logger(os.path.abspath(options.logfile),options.loglevel) 37 prserv.init_logger(os.path.abspath(options.logfile),options.loglevel)
39 38
40 if options.start: 39 if options.start:
41 prserv.serv.start_daemon(options) 40 ret=prserv.serv.start_daemon(dbfile=options.dbfile, interface=(options.host, options.port),
41 logfile=os.path.abspath(options.logfile))
42 elif options.stop:
43 ret=prserv.serv.stop_daemon(options.host, options.port)
42 else: 44 else:
43 prserv.serv.stop_daemon() 45 ret=parser.print_help()
46 return ret
44 47
45if __name__ == "__main__": 48if __name__ == "__main__":
46 try: 49 try: