Jim MacArthur pushed to branch jmac/make_marked_directories at BuildStream / buildstream
Commits:
-
02bb9514
by Jim MacArthur at 2019-01-10T18:18:13Z
1 changed file:
Changes:
... | ... | @@ -28,7 +28,7 @@ import grpc |
28 | 28 |
|
29 | 29 |
from .. import utils
|
30 | 30 |
from .._message import Message, MessageType
|
31 |
-from . import Sandbox, SandboxCommandError
|
|
31 |
+from . import Sandbox, SandboxCommandError, SandboxFlags
|
|
32 | 32 |
from .sandbox import _SandboxBatch
|
33 | 33 |
from ..storage._filebaseddirectory import FileBasedDirectory
|
34 | 34 |
from ..storage._casbaseddirectory import CasBasedDirectory
|
... | ... | @@ -313,6 +313,16 @@ class SandboxRemote(Sandbox): |
313 | 313 |
upload_vdir = CasBasedDirectory(cascache, ref=None)
|
314 | 314 |
upload_vdir.import_files(self.get_virtual_directory()._get_underlying_directory())
|
315 | 315 |
|
316 |
+ # Create directories for all marked directories. This emulates
|
|
317 |
+ # some of the behaviour of other sandboxes, which create these
|
|
318 |
+ # to use as mount points.
|
|
319 |
+ if not flags & SandboxFlags.ROOT_READ_ONLY:
|
|
320 |
+ for mark in self._get_marked_directories():
|
|
321 |
+ directory = mark['directory']
|
|
322 |
+ # Create each marked directory
|
|
323 |
+ print("Automatically creating directory {}".format(directory))
|
|
324 |
+ upload_vdir.descend(directory.split(os.path.sep), create=True)
|
|
325 |
+ |
|
316 | 326 |
upload_vdir.recalculate_hash()
|
317 | 327 |
|
318 | 328 |
# Generate action_digest first
|