diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-12-02 12:41:53 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-02-05 16:55:27 +0100 |
commit | b48edd4199a04d7b10826a270a0bced59c1ec2e2 (patch) | |
tree | 98fa18e3f6b20a399b4d32700a6bc06ce54a617d | |
parent | 9cac160bb2df7f7e5eb061fbb9817d1a50fe3daa (diff) | |
download | buildstream-b48edd4199a04d7b10826a270a0bced59c1ec2e2.tar.gz |
element.py: Do not discard explicitly set mtime of source files
Use the `update_mtime` parameter of `Directory.import_files()` instead
of calling `set_deterministic_mtime()` such that BST_ARBITRARY_TIMESTAMP
is applied only for source files that don't already have an explicitly
set mtime (MTime node property in CAS).
-rw-r--r-- | src/buildstream/element.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index e329fd57a..cb4dc5450 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -92,7 +92,7 @@ from ._variables import Variables from ._versions import BST_CORE_ARTIFACT_VERSION from ._exceptions import BstError, LoadError, ImplError, SourceCacheError from .exceptions import ErrorDomain, LoadErrorReason -from .utils import FileListResult +from .utils import FileListResult, BST_ARBITRARY_TIMESTAMP from . import utils from . import _cachekey from . import _site @@ -1467,11 +1467,10 @@ class Element(Plugin): reason="import-source-files-fail", ) + # Set update_mtime to ensure deterministic mtime of sources at build time with utils._deterministic_umask(): - vdirectory.import_files(import_dir) + vdirectory.import_files(import_dir, update_mtime=BST_ARBITRARY_TIMESTAMP) - # Ensure deterministic mtime of sources at build time - vdirectory.set_deterministic_mtime() # Ensure deterministic owners of sources at build time vdirectory.set_deterministic_user() |