diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2018-09-04 14:51:51 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2018-09-14 09:53:14 +0100 |
commit | 233a7d8372d4df5ee85edd902c1c54d7d658b202 (patch) | |
tree | 81599dc5c009461cce7ff25ea2bc53a1fa076ffd /buildstream/utils.py | |
parent | fc7f83ac1d48e4d9684296153082ce32231bdcb0 (diff) | |
download | buildstream-233a7d8372d4df5ee85edd902c1c54d7d658b202.tar.gz |
Handle sockets when copying trees into artifacts
We can't include a socket in a CAS tree, but it's mostly meaningless to do so
since there can't possibly be a process serving it.
Diffstat (limited to 'buildstream/utils.py')
-rw-r--r-- | buildstream/utils.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py index 1aeea52be..60211f35b 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -372,6 +372,8 @@ def copy_files(src, dest, *, files=None, ignore_missing=False, report_written=Fa Directories in `dest` are replaced with files from `src`, unless the existing directory in `dest` is not empty in which case the path will be reported in the return value. + + UNIX domain socket files from `src` are ignored. """ presorted = False if files is None: @@ -414,6 +416,8 @@ def link_files(src, dest, *, files=None, ignore_missing=False, report_written=Fa If a hardlink cannot be created due to crossing filesystems, then the file will be copied instead. + + UNIX domain socket files from `src` are ignored. """ presorted = False if files is None: @@ -841,6 +845,13 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result, os.mknod(destpath, file_stat.st_mode, file_stat.st_rdev) os.chmod(destpath, file_stat.st_mode) + elif stat.S_ISFIFO(mode): + os.mkfifo(destpath, mode) + + elif stat.S_ISSOCK(mode): + # We can't duplicate the process serving the socket anyway + pass + else: # Unsupported type. raise UtilError('Cannot extract {} into staging-area. Unsupported type.'.format(srcpath)) |