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