Ejemplo n.º 1
0
 def _installed_directories(self):
     for path in os.environ["PATH"].split(os.pathsep):
         if not os.path.exists(path):
             continue
         for e in os.listdir(path):
             b = Path(os.path.join(path, e))
             if b.is_file() and b.filename() in CLANG_BINARIES:
                 yield b.directory()
Ejemplo n.º 2
0
 def _parameter_directory(self, path_arg_str):
     p = Path(path_arg_str)
     p.assert_exists()
     # Tarball-download versions of clang put binaries in a bin/
     # subdirectory. For convenience, tolerate a parameter of either:
     # <unpacked_tarball>, <unpacked tarball>/bin or
     # <unpacked_tarball>/bin/<specific_binary>
     if p.is_file():
         return p.directory()
     bin_subdir = os.path.join(str(p), "bin/")
     if os.path.exists(bin_subdir):
         return bin_subdir
     return str(p)