diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-10-06 09:36:42 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-09 15:48:44 +0100 |
commit | 840d60de78f60f3f0cf90cc962231cd851974763 (patch) | |
tree | 62e5873ea7d1c460d18c9eb5fb8bb8463766cd31 /bitbake/bin | |
parent | 61f5c323082d814df8a19aa08300f3c47b0a6b1a (diff) | |
download | poky-840d60de78f60f3f0cf90cc962231cd851974763.tar.gz |
bitbake: bitbake-hashclient: Add remove subcommand
Adds a subcommand to invoke the remove API on the server
(Bitbake rev: a778b99e6a2a1a1e1b7eb26d48313fadcd34de54)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake-hashclient | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-hashclient b/bitbake/bin/bitbake-hashclient index 494f17592a..d09104336a 100755 --- a/bitbake/bin/bitbake-hashclient +++ b/bitbake/bin/bitbake-hashclient | |||
@@ -113,6 +113,14 @@ def main(): | |||
113 | with lock: | 113 | with lock: |
114 | pbar.update() | 114 | pbar.update() |
115 | 115 | ||
116 | def handle_remove(args, client): | ||
117 | where = {k: v for k, v in args.where} | ||
118 | if where: | ||
119 | result = client.remove(where) | ||
120 | print("Removed %d row(s)" % (result["count"])) | ||
121 | else: | ||
122 | print("No query specified") | ||
123 | |||
116 | parser = argparse.ArgumentParser(description='Hash Equivalence Client') | 124 | parser = argparse.ArgumentParser(description='Hash Equivalence Client') |
117 | parser.add_argument('--address', default=DEFAULT_ADDRESS, help='Server address (default "%(default)s")') | 125 | parser.add_argument('--address', default=DEFAULT_ADDRESS, help='Server address (default "%(default)s")') |
118 | parser.add_argument('--log', default='WARNING', help='Set logging level') | 126 | parser.add_argument('--log', default='WARNING', help='Set logging level') |
@@ -137,6 +145,11 @@ def main(): | |||
137 | help='Include string in outhash') | 145 | help='Include string in outhash') |
138 | stress_parser.set_defaults(func=handle_stress) | 146 | stress_parser.set_defaults(func=handle_stress) |
139 | 147 | ||
148 | remove_parser = subparsers.add_parser('remove', help="Remove hash entries") | ||
149 | remove_parser.add_argument("--where", "-w", metavar="KEY VALUE", nargs=2, action="append", default=[], | ||
150 | help="Remove entries from table where KEY == VALUE") | ||
151 | remove_parser.set_defaults(func=handle_remove) | ||
152 | |||
140 | args = parser.parse_args() | 153 | args = parser.parse_args() |
141 | 154 | ||
142 | logger = logging.getLogger('hashserv') | 155 | logger = logging.getLogger('hashserv') |