summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-23 15:04:26 +0100
committerJürg Billeter <j@bitron.ch>2019-02-26 12:08:27 +0100
commit80656e36dfae1f0628226ebf0ed465b9ccfcd1bb (patch)
tree25714954ad56817543900c5904547584f9fd6801
parent85b65369486dda7eb81560f5ee3ded8a23e878d6 (diff)
downloadbuildstream-80656e36dfae1f0628226ebf0ed465b9ccfcd1bb.tar.gz
storage: Rename update_utimes parameter to update_mtime
utime is short for 'update time' and only the mtime is significant.
-rw-r--r--buildstream/element.py2
-rw-r--r--buildstream/storage/_casbaseddirectory.py6
-rw-r--r--buildstream/storage/_filebaseddirectory.py6
-rw-r--r--buildstream/storage/directory.py6
4 files changed, 10 insertions, 10 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 5c06065b4..cb252fe25 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -683,7 +683,7 @@ class Element(Plugin):
copy_files = []
link_result = vstagedir.import_files(artifact, files=link_files, report_written=True, can_link=True)
- copy_result = vstagedir.import_files(artifact, files=copy_files, report_written=True, update_utimes=True)
+ copy_result = vstagedir.import_files(artifact, files=copy_files, report_written=True, update_mtime=True)
return link_result.combine(copy_result)
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 0ff7ea80b..cec45faf7 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -414,7 +414,7 @@ class CasBasedDirectory(Directory):
return result
def import_files(self, external_pathspec, *, files=None,
- report_written=True, update_utimes=False,
+ report_written=True, update_mtime=False,
can_link=False):
"""Imports some or all files from external_path into this directory.
@@ -430,7 +430,7 @@ class CasBasedDirectory(Directory):
written. Defaults to true. If false, only a list of
overwritten files is returned.
- update_utimes (bool): Currently ignored, since CAS does not store utimes.
+ update_mtime (bool): Currently ignored, since CAS does not store mtimes.
can_link (bool): Ignored, since hard links do not have any meaning within CAS.
"""
@@ -452,7 +452,7 @@ class CasBasedDirectory(Directory):
assert isinstance(external_pathspec, CasBasedDirectory)
result = self._partial_import_cas_into_cas(external_pathspec, files=list(files))
- # TODO: No notice is taken of report_written, update_utimes or can_link.
+ # TODO: No notice is taken of report_written, update_mtime or can_link.
# Current behaviour is to fully populate the report, which is inefficient,
# but still correct.
diff --git a/buildstream/storage/_filebaseddirectory.py b/buildstream/storage/_filebaseddirectory.py
index 0752a0e05..6302dbe9c 100644
--- a/buildstream/storage/_filebaseddirectory.py
+++ b/buildstream/storage/_filebaseddirectory.py
@@ -103,7 +103,7 @@ class FileBasedDirectory(Directory):
raise VirtualDirectoryError(error.format(subdirectory_spec[0], self.external_directory))
def import_files(self, external_pathspec, *, files=None,
- report_written=True, update_utimes=False,
+ report_written=True, update_mtime=False,
can_link=False):
""" See superclass Directory for arguments """
@@ -112,13 +112,13 @@ class FileBasedDirectory(Directory):
else:
source_directory = external_pathspec
- if can_link and not update_utimes:
+ if can_link and not update_mtime:
import_result = link_files(source_directory, self.external_directory, files=files,
ignore_missing=False, report_written=report_written)
else:
import_result = copy_files(source_directory, self.external_directory, files=files,
ignore_missing=False, report_written=report_written)
- if update_utimes:
+ if update_mtime:
cur_time = time.time()
for f in import_result.files_written:
diff --git a/buildstream/storage/directory.py b/buildstream/storage/directory.py
index f572257d7..4b83b38e7 100644
--- a/buildstream/storage/directory.py
+++ b/buildstream/storage/directory.py
@@ -72,7 +72,7 @@ class Directory():
# Import and export of files and links
def import_files(self, external_pathspec, *, files=None,
- report_written=True, update_utimes=False,
+ report_written=True, update_mtime=False,
can_link=False):
"""Imports some or all files from external_path into this directory.
@@ -85,13 +85,13 @@ class Directory():
report_written (bool): Return the full list of files
written. Defaults to true. If false, only a list of
overwritten files is returned.
- update_utimes (bool): Update the access and modification time
+ update_mtime (bool): Update the access and modification time
of each file copied to the current time.
can_link (bool): Whether it's OK to create a hard link to the
original content, meaning the stored copy will change when the
original files change. Setting this doesn't guarantee hard
links will be made. can_link will never be used if
- update_utimes is set.
+ update_mtime is set.
Yields:
(FileListResult) - A report of files imported and overwritten.