dhrystone: fix build, overlay directory was not being created

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-10-29 00:00:00 +00:00
parent 73882a2bcc
commit 2cfb389c5a
3 changed files with 15 additions and 7 deletions

View File

@@ -162,14 +162,15 @@ class ShellHelpers:
ending = last_newline + ';'
return newline_separator.join(out) + ending
def copy_file_if_update(self, src, dest):
if os.path.isdir(dest):
dest = os.path.join(dest, os.path.basename(src))
def copy_file_if_update(self, src, destfile):
if os.path.isdir(destfile):
destfile = os.path.join(destfile, os.path.basename(src))
self.mkdir_p(os.path.dirname(destfile))
if (
not os.path.exists(dest) or \
os.path.getmtime(src) > os.path.getmtime(dest)
not os.path.exists(destfile) or \
os.path.getmtime(src) > os.path.getmtime(destfile)
):
self.cp(src, dest)
self.cp(src, destfile)
def copy_dir_if_update_non_recursive(
self,
@@ -221,6 +222,11 @@ class ShellHelpers:
else:
shutil.copy2(src, dest)
def mkdir_p(self, d):
self.print_cmd(['mkdir', d, LF])
if not self.dry_run:
os.makedirs(d, exist_ok=True)
def mv(self, src, dest, **kwargs):
self.print_cmd(['mv', src, dest])
if not self.dry_run: