2016-07-08 18:17:58 +00:00
|
|
|
from os import walk
|
2016-07-08 20:16:20 +00:00
|
|
|
from os.path import join, abspath, dirname, basename, splitext
|
2016-07-08 20:10:30 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
ROOT = abspath(join(dirname(__file__), "..", ".."))
|
|
|
|
sys.path.insert(0, ROOT)
|
|
|
|
|
|
|
|
from tools.toolchains.gcc import GCC_ARM
|
|
|
|
from tools.targets import TARGET_MAP
|
2016-07-08 18:17:58 +00:00
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
parser = ArgumentParser("Find duplicate file names within a directory structure")
|
|
|
|
parser.add_argument("dirs", help="Directories to search for duplicate file names"
|
|
|
|
, nargs="*")
|
|
|
|
parser.add_argument("--silent", help="Supress printing of filenames, just return number of duplicates", action="store_true")
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2016-07-08 20:10:30 +00:00
|
|
|
toolchain = GCC_ARM(TARGET_MAP[".Super-Target"])
|
|
|
|
|
|
|
|
resources = sum([toolchain.scan_resources(d) for d in args.dirs], None)
|
|
|
|
|
2016-07-08 18:17:58 +00:00
|
|
|
scanned_files = {}
|
|
|
|
|
2016-09-28 18:38:25 +00:00
|
|
|
exit(resources.detect_duplicates())
|
2016-07-08 18:17:58 +00:00
|
|
|
|