From e56b0b3e5a053e13527fe06ad1de2f9704b91121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 10 Mar 2019 00:00:01 +0000 Subject: [PATCH] userland: copy subdirs to target --- build-userland | 2 +- shell_helpers.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/build-userland b/build-userland index 9f2ec81..cbc700f 100755 --- a/build-userland +++ b/build-userland @@ -83,7 +83,7 @@ has the OpenBLAS libraries and headers installed. cwd=self.env['userland_source_dir'], extra_paths=[self.env['ccache_dir']], ) - self.sh.copy_dir_if_update_non_recursive( + self.sh.copy_dir_if_update( srcdir=build_dir, destdir=self.env['out_rootfs_overlay_dir'], filter_ext=self.env['userland_build_ext'], diff --git a/shell_helpers.py b/shell_helpers.py index 3d7283f..58790ba 100644 --- a/shell_helpers.py +++ b/shell_helpers.py @@ -133,6 +133,20 @@ class ShellHelpers: update=1, ) + def copy_dir_if_update(self, srcdir, destdir, filter_ext=None): + self.copy_dir_if_update_non_recursive(srcdir, destdir, filter_ext) + srcdir_abs = os.path.abspath(srcdir) + srcdir_abs_len = len(srcdir_abs) + for path, dirnames, filenames in os.walk(srcdir_abs): + for dirname in dirnames: + dirpath = os.path.join(path, dirname) + dirpath_relative_root = dirpath[srcdir_abs_len + 1:] + self.copy_dir_if_update_non_recursive( + dirpath, + os.path.join(destdir, dirpath_relative_root), + filter_ext + ) + def cp(self, src, dest, **kwargs): self.print_cmd(['cp', src, dest]) if not self.dry_run: