diff --git a/ardumont/list-origin-per-error.py b/ardumont/list-origin-per-error.py new file mode 100755 index 0000000..41cb2a8 --- /dev/null +++ b/ardumont/list-origin-per-error.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Use sample: +# cat loader-git-disk-errors-july-27-28-2017 | grep googlecode | grep NotGitRepository | ./list-origin-per-error.py + +import ast +import click +import sys + + +@click.command() +def main(): + for line in sys.stdin: + line = line.rstrip() + data = ast.literal_eval(line) + args = data['args'] + if 'gitorious' in args['origin_url']: + key = 'directory' + elif 'googlecode' in args['origin_url']: + key = 'archive_path' + else: + continue + print('%s %s' % (args['origin_url'], args[key])) + + +if __name__ == '__main__': + main()