diff --git a/ardumont/check_for_dump_clash.py b/ardumont/check_for_dump_clash.py new file mode 100755 index 0000000..4e3077c --- /dev/null +++ b/ardumont/check_for_dump_clash.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import click +import os +import sys + +from collections import defaultdict + + +def read(): + m = defaultdict(list) + for line in sys.stdin: + path = line.rstrip() + project_name = os.path.basename(os.path.dirname(path)) + m[project_name].append(path) + + for project_name, paths in m.items(): + if len(paths) > 1: + yield project_name, paths + + +@click.command( + help="""Dump code.google.com path for which a name clash exists in dumps + coming from apache-extras and eclipselabs...""") +def main(): + for project_name, paths in read(): + for path in paths: + if 'apache-extras' not in path and 'eclipselabs' not in path: + print(path) + + +if __name__ == '__main__': + main()