diff options
Diffstat (limited to 'bitbake/bin/bitbake-hashserv')
-rwxr-xr-x | bitbake/bin/bitbake-hashserv | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/bitbake/bin/bitbake-hashserv b/bitbake/bin/bitbake-hashserv index 6c911c098a..1bc1f91f38 100755 --- a/bitbake/bin/bitbake-hashserv +++ b/bitbake/bin/bitbake-hashserv | |||
@@ -11,20 +11,26 @@ import logging | |||
11 | import argparse | 11 | import argparse |
12 | import sqlite3 | 12 | import sqlite3 |
13 | 13 | ||
14 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),'lib')) | 14 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib')) |
15 | 15 | ||
16 | import hashserv | 16 | import hashserv |
17 | 17 | ||
18 | VERSION = "1.0.0" | 18 | VERSION = "1.0.0" |
19 | 19 | ||
20 | DEFAULT_HOST = '' | 20 | DEFAULT_BIND = 'unix://./hashserve.sock' |
21 | DEFAULT_PORT = 8686 | 21 | |
22 | 22 | ||
23 | def main(): | 23 | def main(): |
24 | parser = argparse.ArgumentParser(description='HTTP Equivalence Reference Server. Version=%s' % VERSION) | 24 | parser = argparse.ArgumentParser(description='Hash Equivalence Reference Server. Version=%s' % VERSION, |
25 | parser.add_argument('--address', default=DEFAULT_HOST, help='Bind address (default "%(default)s")') | 25 | epilog='''The bind address is the path to a unix domain socket if it is |
26 | parser.add_argument('--port', type=int, default=DEFAULT_PORT, help='Bind port (default %(default)d)') | 26 | prefixed with "unix://". Otherwise, it is an IP address |
27 | parser.add_argument('--prefix', default='', help='HTTP path prefix (default "%(default)s")') | 27 | and port in form ADDRESS:PORT. To bind to all addresses, leave |
28 | the ADDRESS empty, e.g. "--bind :8686". To bind to a specific | ||
29 | IPv6 address, enclose the address in "[]", e.g. | ||
30 | "--bind [::1]:8686"''' | ||
31 | ) | ||
32 | |||
33 | parser.add_argument('--bind', default=DEFAULT_BIND, help='Bind address (default "%(default)s")') | ||
28 | parser.add_argument('--database', default='./hashserv.db', help='Database file (default "%(default)s")') | 34 | parser.add_argument('--database', default='./hashserv.db', help='Database file (default "%(default)s")') |
29 | parser.add_argument('--log', default='WARNING', help='Set logging level') | 35 | parser.add_argument('--log', default='WARNING', help='Set logging level') |
30 | 36 | ||
@@ -41,10 +47,11 @@ def main(): | |||
41 | console.setLevel(level) | 47 | console.setLevel(level) |
42 | logger.addHandler(console) | 48 | logger.addHandler(console) |
43 | 49 | ||
44 | server = hashserv.create_server((args.address, args.port), args.database, args.prefix) | 50 | server = hashserv.create_server(args.bind, args.database) |
45 | server.serve_forever() | 51 | server.serve_forever() |
46 | return 0 | 52 | return 0 |
47 | 53 | ||
54 | |||
48 | if __name__ == '__main__': | 55 | if __name__ == '__main__': |
49 | try: | 56 | try: |
50 | ret = main() | 57 | ret = main() |
@@ -53,4 +60,3 @@ if __name__ == '__main__': | |||
53 | import traceback | 60 | import traceback |
54 | traceback.print_exc() | 61 | traceback.print_exc() |
55 | sys.exit(ret) | 62 | sys.exit(ret) |
56 | |||