diff options
| author | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-18 10:12:27 +0100 |
|---|---|---|
| committer | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-18 11:18:29 +0100 |
| commit | 5d5ec87f81ce9787e270dadf4ccaa59f2293db2c (patch) | |
| tree | 9816f372a4eb7b2a7f44a9e62cf94a2f37f0200f | |
| parent | 77ab8c2f57fdd74f8dddf6f716f4ddef78a00693 (diff) | |
| download | buildstream-5d5ec87f81ce9787e270dadf4ccaa59f2293db2c.tar.gz | |
local.py: use extended source api for staging
| -rw-r--r-- | src/buildstream/plugins/sources/local.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/buildstream/plugins/sources/local.py b/src/buildstream/plugins/sources/local.py index e28098c38..9fe13da9f 100644 --- a/src/buildstream/plugins/sources/local.py +++ b/src/buildstream/plugins/sources/local.py @@ -92,19 +92,8 @@ class LocalSource(Source): # Nothing to do here for a local source pass # pragma: nocover - def stage(self, directory): - # directory should always be a Directory object - assert isinstance(directory, Directory) - with self.timed_activity("Staging local files into CAS"): - if os.path.isdir(self.fullpath) and not os.path.islink(self.fullpath): - result = directory.import_files(self.fullpath) - else: - result = directory.import_single_file(self.fullpath) - - if result.overwritten or result.ignored: - raise SourceError( - "Failed to stage source: files clash with existing directory", - reason='ensure-stage-dir-fail') + def stage(self, directory: Directory) -> None: + self.stage_into_directory(self.fullpath, directory) def _get_local_path(self): return self.fullpath |
