| if e.errno != errno.EEXIST: |
| print("Incorrect number of arguments specified") |
| print("syntax: gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir>") |
| print('Reading %s' % sys.argv[1]) |
| with open(sys.argv[1]) as f: |
| sigs.append(l.split(":")[2].split()[0]) |
| print('Gathering file list') |
| p = sys.argv[2] + "/" + s[:2] + "/*" + s + "*" |
| files |= set(glob.glob(p)) |
| p = sys.argv[2] + "/*/" + s[:2] + "/*" + s + "*" |
| files |= set(glob.glob(p)) |
| print('Processing files') |
| sys.stdout.write('Processing %s... ' % f) |
| _, ext = os.path.splitext(f) |
| if not ext in ['.tgz', '.siginfo', '.sig']: |
| # Most likely a temp file, skip it |
| dst = os.path.join(sys.argv[3], os.path.relpath(f, sys.argv[2])) |
| destdir = os.path.dirname(dst) |
| if (os.stat(f).st_dev == os.stat(destdir).st_dev): |