summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-06-04 12:44:14 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-07-24 14:39:00 +0100
commit4acd26760bf0e188872fd0e5d6dd37ed27267370 (patch)
treebf29e87c8ba49ee8a0137213c49301bfc3bed680
parent357c3995a44cd38eedd8016a0512a46f76680e90 (diff)
downloadbuildstream-4acd26760bf0e188872fd0e5d6dd37ed27267370.tar.gz
_filebaseddirectory/directory.py: Move VirtualDirectoryError to Directory
-rw-r--r--buildstream/storage/_filebaseddirectory.py15
-rw-r--r--buildstream/storage/directory.py15
2 files changed, 17 insertions, 13 deletions
diff --git a/buildstream/storage/_filebaseddirectory.py b/buildstream/storage/_filebaseddirectory.py
index 1f2b16cdf..06b3ae0ce 100644
--- a/buildstream/storage/_filebaseddirectory.py
+++ b/buildstream/storage/_filebaseddirectory.py
@@ -33,22 +33,11 @@ import calendar
import os
import time
from .._exceptions import BstError, ErrorDomain
-from .directory import Directory
-from ..utils import link_files, copy_files, list_relative_paths
+from .directory import Directory, VirtualDirectoryError
+from ..utils import link_files, copy_files, FileListResult, list_relative_paths
from ..utils import _set_deterministic_user, _set_deterministic_mtime
-class VirtualDirectoryError(BstError):
- """Raised by Directory functions when system calls fail.
- This will be handled internally by the BuildStream core,
- if you need to handle this error, then it should be reraised,
- or either of the :class:`.ElementError` or :class:`.SourceError`
- exceptions should be raised from this error.
- """
- def __init__(self, message, reason=None):
- super().__init__(message, domain=ErrorDomain.VIRTUAL_FS, reason=reason)
-
-
# Like os.path.getmtime(), but doesnt explode on symlinks
# Copy/pasted from compose.py
def getmtime(path):
diff --git a/buildstream/storage/directory.py b/buildstream/storage/directory.py
index e62bd3e27..ad008fab2 100644
--- a/buildstream/storage/directory.py
+++ b/buildstream/storage/directory.py
@@ -31,6 +31,21 @@ See also: :ref:`sandboxing`.
"""
+from typing import List
+from ..utils import FileListResult
+from .._exceptions import BstError, ErrorDomain
+
+
+class VirtualDirectoryError(BstError):
+ """Raised by Directory functions when system calls fail.
+ This will be handled internally by the BuildStream core,
+ if you need to handle this error, then it should be reraised,
+ or either of the :class:`.ElementError` or :class:`.SourceError`
+ exceptions should be raised from this error.
+ """
+ def __init__(self, message, reason=None):
+ super().__init__(message, domain=ErrorDomain.VIRTUAL_FS, reason=reason)
+
class Directory():
def __init__(self, external_directory=None):