path: root/bin/bitbake-prserv
diff options
authorLianhao Lu <>2012-01-10 14:13:49 +0800
committerRichard Purdie <>2012-01-11 10:35:41 +0000
commit379567ee879dcdc09a51f7f1212bde1076147a6f (patch)
tree2b15731e32ed3ec085513caf266d727fc017e910 /bin/bitbake-prserv
parenteac9249b40ae1e3aa21e016010c862664e59a8d4 (diff)
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. Signed-off-by: Lianhao Lu <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'bin/bitbake-prserv')
1 files changed, 13 insertions, 10 deletions
diff --git a/bin/bitbake-prserv b/bin/bitbake-prserv
index 14073caf38..a7ab55f736 100755
--- a/bin/bitbake-prserv
+++ b/bin/bitbake-prserv
@@ -16,31 +16,34 @@ PRPORT_DEFAULT=8585
def main():
parser = optparse.OptionParser(
version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
- usage = "%prog [options]")
+ usage = "%prog < --start | --stop > [options]")
- parser.add_option("-f", "--file", help="database filename(default prserv.db)", action="store",
+ parser.add_option("-f", "--file", help="database filename(default: prserv.db)", action="store",
dest="dbfile", type="string", default="prserv.db")
- parser.add_option("-l", "--log", help="log filename(default prserv.log)", action="store",
+ parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store",
dest="logfile", type="string", default="prserv.log")
parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
- action = "store", type="string", dest="loglevel", default = "WARNING")
+ action = "store", type="string", dest="loglevel", default = "INFO")
parser.add_option("--start", help="start daemon",
- action="store_true", dest="start", default="True")
+ action="store_true", dest="start")
parser.add_option("--stop", help="stop daemon",
- action="store_false", dest="start")
+ action="store_true", dest="stop")
parser.add_option("--host", help="ip address to bind", action="store",
dest="host", type="string", default=PRHOST_DEFAULT)
- parser.add_option("--port", help="port number(default 8585)", action="store",
+ parser.add_option("--port", help="port number(default: 8585)", action="store",
dest="port", type="int", default=PRPORT_DEFAULT)
options, args = parser.parse_args(sys.argv)
if options.start:
- prserv.serv.start_daemon(options)
+ ret=prserv.serv.start_daemon(dbfile=options.dbfile, interface=(, options.port),
+ logfile=os.path.abspath(options.logfile))
+ elif options.stop:
+ ret=prserv.serv.stop_daemon(, options.port)
- prserv.serv.stop_daemon()
+ ret=parser.print_help()
+ return ret
if __name__ == "__main__":