summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2019-03-25 15:57:23 +0000
committerWilliam Salmon <will.salmon@codethink.co.uk>2019-03-25 16:26:55 +0000
commitd76af9df32c6164a2e1e61861dd53f27a4fa358c (patch)
tree42ea078b0f8e953fa85f9240399ecdb7baa63cdb
parent38d4c2ce4b182be71384d2f9f9a3d6374075a98c (diff)
downloadbuildstream-willsalmon/simpletest.tar.gz
Refactor local source to use the shinny newwillsalmon/simpletest
-rw-r--r--buildstream/plugins/sources/local.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/buildstream/plugins/sources/local.py b/buildstream/plugins/sources/local.py
index 50df85427..e5f8c0de1 100644
--- a/buildstream/plugins/sources/local.py
+++ b/buildstream/plugins/sources/local.py
@@ -97,33 +97,11 @@ class LocalSource(Source):
with self.timed_activity("Staging local files at {}".format(self.path)):
if os.path.isdir(self.fullpath):
- files = list(utils.list_relative_paths(self.fullpath))
utils.copy_files(self.fullpath, directory)
else:
destfile = os.path.join(directory, os.path.basename(self.path))
- files = [os.path.basename(self.path)]
utils.safe_copy(self.fullpath, destfile)
- for f in files:
- # Non empty directories are not listed by list_relative_paths
- dirs = f.split(os.sep)
- for i in range(1, len(dirs)):
- d = os.path.join(directory, *(dirs[:i]))
- assert os.path.isdir(d) and not os.path.islink(d)
- os.chmod(d, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
-
- path = os.path.join(directory, f)
- if os.path.islink(path):
- pass
- elif os.path.isdir(path):
- os.chmod(path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
- else:
- st = os.stat(path)
- if st.st_mode & stat.S_IXUSR:
- os.chmod(path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
- else:
- os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
-
def _get_local_path(self):
return self.fullpath