52 copied_files = []
53
54
56 names = os.listdir(src)
57 if ignore is not None:
58 ignored_names = ignore(src, names)
59 else:
61
62 if not os.path.exists(dst):
63 os.makedirs(dst)
64 for name in names:
65 if name in ignored_names:
66 continue
67 srcname = os.path.join(src, name)
68 dstname = os.path.join(dst, name)
69 try:
70 if os.path.isdir(srcname):
71 copy_tree(srcname, dstname, ignore, errors)
72 else:
73 copied_files.append(srcname)
74 shutil.copy(srcname, dstname)
75 except (IOError, os.error) as why:
76 errors.append((srcname, dstname, str(why)))
77 try:
78 shutil.copystat(src, dst)
79 except WindowsError:
80
81 pass
82 except OSError as why:
83 errors.append((src, dst, str(why)))
84
85
86 def format_error(error):
88 return "Error: {msg}".
format(msg=str(error[0]))
89 return "From: {src}\nTo: {dst}\n{msg}" \
90 .
format(src=error[0], dst=error[1], msg=error[2])
91
92 errors = []
94 if errors:
95 failures =
"\n\n".
join(format_error(error)
for error
in errors)
96 parts = ("Some file copies failed:", "=" * 78, failures)
97 msg =
'\n'.
join(parts)
98 raise RuntimeError(msg)
99
100 return copied_files
101
102
uint32_t uint32_t * format
def CopyTree(src, dst, ignore=None)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
static SkString join(const CommandLineFlags::StringArray &)