diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-12-10 14:11:22 +0000 |
---|---|---|
committer | Darius Makovsky <traveltissues@protonmail.com> | 2020-01-16 08:49:30 +0000 |
commit | 7acfddd3e27eda65696dcc81d81a578948ddb2fa (patch) | |
tree | 1d2726821f6dbee1dc9576d95339e52c692c6f73 | |
parent | 4f7a3105658e5842aca28a9048a7a39a97eb14f0 (diff) | |
download | buildstream-7acfddd3e27eda65696dcc81d81a578948ddb2fa.tar.gz |
Support properties in import_files()
-rw-r--r-- | src/buildstream/storage/_casbaseddirectory.py | 2 | ||||
-rw-r--r-- | src/buildstream/storage/_filebaseddirectory.py | 9 | ||||
-rw-r--r-- | src/buildstream/storage/directory.py | 7 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index 46984041e..bfa3f823e 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -356,7 +356,7 @@ class CasBasedDirectory(Directory): # content into this CasBasedDirectory using CAS-to-CAS import # to write the report, handle possible conflicts (if the target # directory is not empty) and apply the optional filter. - digest = self.cas_cache.import_directory(external_pathspec) + digest = self.cas_cache.import_directory(external_pathspec, properties=properties) external_pathspec = CasBasedDirectory(self.cas_cache, digest=digest) assert isinstance(external_pathspec, CasBasedDirectory) diff --git a/src/buildstream/storage/_filebaseddirectory.py b/src/buildstream/storage/_filebaseddirectory.py index 222b47979..95d113ec3 100644 --- a/src/buildstream/storage/_filebaseddirectory.py +++ b/src/buildstream/storage/_filebaseddirectory.py @@ -79,7 +79,14 @@ class FileBasedDirectory(Directory): return current_dir def import_files( - self, external_pathspec, *, filter_callback=None, report_written=True, update_mtime=False, can_link=False + self, + external_pathspec, + *, + filter_callback=None, + report_written=True, + update_mtime=False, + can_link=False, + properties=None ): """ See superclass Directory for arguments """ diff --git a/src/buildstream/storage/directory.py b/src/buildstream/storage/directory.py index 89d20c433..4cec772fe 100644 --- a/src/buildstream/storage/directory.py +++ b/src/buildstream/storage/directory.py @@ -32,7 +32,7 @@ See also: :ref:`sandboxing`. """ -from typing import Callable, Optional, Union +from typing import Callable, Optional, Union, List from .._exceptions import BstError, ErrorDomain from ..types import FastEnum @@ -82,7 +82,8 @@ class Directory: filter_callback: Optional[Callable[[str], bool]] = None, report_written: bool = True, update_mtime: bool = False, - can_link: bool = False + can_link: bool = False, + properties: Optional[List[str]] = None ) -> FileListResult: """Imports some or all files from external_path into this directory. @@ -103,6 +104,8 @@ class Directory: original files change. Setting this doesn't guarantee hard links will be made. can_link will never be used if update_mtime is set. + properties: Optional list of strings representing file properties + to capture when importing. Yields: A report of files imported and overwritten. |