1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/usr/bin/env python
#===- make/filter-inputs ---------------------------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
# Given a list of files, return a new list of files taking only the
# first file for any particular filename.
def main():
import os,sys
seen = set()
for file in sys.argv[1:]:
base = os.path.basename(file)
if base not in seen:
seen.add(base)
print file
if __name__ == '__main__':
main()
|