diff options
| author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-30 10:03:43 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-02 18:04:23 +0000 |
| commit | 6b6374c336016ee56ff7418c45d1eba2eac95b21 (patch) | |
| tree | e50773f8af86e7c4760ac68fdc40107c6b420b6f /bitbake/bin | |
| parent | 5b18ff6d6bef14cf590be4649b4d27134928c23b (diff) | |
| download | poky-6b6374c336016ee56ff7418c45d1eba2eac95b21.tar.gz | |
bitbake: bitbake-hashclient: Add commands to get hashes
Adds subcommands to query the server for equivalent hashes and for
output hashes.
(Bitbake rev: 36ba202232399738670c9fb11169ead5590a3e82)
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 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-hashclient b/bitbake/bin/bitbake-hashclient index 3ff7b76378..2cb6338666 100755 --- a/bitbake/bin/bitbake-hashclient +++ b/bitbake/bin/bitbake-hashclient | |||
| @@ -52,6 +52,22 @@ def print_user(u): | |||
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | def main(): | 54 | def main(): |
| 55 | def handle_get(args, client): | ||
| 56 | result = client.get_taskhash(args.method, args.taskhash, all_properties=True) | ||
| 57 | if not result: | ||
| 58 | return 0 | ||
| 59 | |||
| 60 | print(json.dumps(result, sort_keys=True, indent=4)) | ||
| 61 | return 0 | ||
| 62 | |||
| 63 | def handle_get_outhash(args, client): | ||
| 64 | result = client.get_outhash(args.method, args.outhash, args.taskhash) | ||
| 65 | if not result: | ||
| 66 | return 0 | ||
| 67 | |||
| 68 | print(json.dumps(result, sort_keys=True, indent=4)) | ||
| 69 | return 0 | ||
| 70 | |||
| 55 | def handle_stats(args, client): | 71 | def handle_stats(args, client): |
| 56 | if args.reset: | 72 | if args.reset: |
| 57 | s = client.reset_stats() | 73 | s = client.reset_stats() |
| @@ -189,6 +205,17 @@ def main(): | |||
| 189 | 205 | ||
| 190 | subparsers = parser.add_subparsers() | 206 | subparsers = parser.add_subparsers() |
| 191 | 207 | ||
| 208 | get_parser = subparsers.add_parser('get', help="Get the unihash for a taskhash") | ||
| 209 | get_parser.add_argument("method", help="Method to query") | ||
| 210 | get_parser.add_argument("taskhash", help="Task hash to query") | ||
| 211 | get_parser.set_defaults(func=handle_get) | ||
| 212 | |||
| 213 | get_outhash_parser = subparsers.add_parser('get-outhash', help="Get output hash information") | ||
| 214 | get_outhash_parser.add_argument("method", help="Method to query") | ||
| 215 | get_outhash_parser.add_argument("outhash", help="Output hash to query") | ||
| 216 | get_outhash_parser.add_argument("taskhash", help="Task hash to query") | ||
| 217 | get_outhash_parser.set_defaults(func=handle_get_outhash) | ||
| 218 | |||
| 192 | stats_parser = subparsers.add_parser('stats', help='Show server stats') | 219 | stats_parser = subparsers.add_parser('stats', help='Show server stats') |
| 193 | stats_parser.add_argument('--reset', action='store_true', | 220 | stats_parser.add_argument('--reset', action='store_true', |
| 194 | help='Reset server stats') | 221 | help='Reset server stats') |
