From c45ea0d36a3f7fea67f5b98f2757672c174619aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Wed, 22 Jan 2020 13:15:34 +0100 Subject: element.py: stage_artifact(): Drop unused update_mtimes parameter --- src/buildstream/element.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 4d91976f9..6a3717635 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -75,7 +75,6 @@ Class Reference import os import re import stat -import time import copy from collections import OrderedDict import contextlib @@ -626,8 +625,7 @@ class Element(Plugin): path: str = None, include: Optional[List[str]] = None, exclude: Optional[List[str]] = None, - orphans: bool = True, - update_mtimes: Optional[List[str]] = None + orphans: bool = True ) -> FileListResult: """Stage this element's output artifact in the sandbox @@ -642,7 +640,6 @@ class Element(Plugin): include: An optional list of domains to include files from exclude: An optional list of domains to exclude files from orphans: Whether to include files not spoken for by split domains - update_mtimes: An optional list of files whose mtimes to set to the current time. Raises: (:class:`.ElementError`): If the element has not yet produced an artifact. @@ -672,9 +669,6 @@ class Element(Plugin): ) raise ElementError("No artifacts to stage", detail=detail, reason="uncached-checkout-attempt") - if update_mtimes is None: - update_mtimes = [] - # Time to use the artifact, check once more that it's there self.__assert_cached() @@ -690,28 +684,10 @@ class Element(Plugin): split_filter = self.__split_filter_func(include, exclude, orphans) - # We must not hardlink files whose mtimes we want to update - if update_mtimes: - - def link_filter(path): - return (split_filter is None or split_filter(path)) and path not in update_mtimes - - def copy_filter(path): - return (split_filter is None or split_filter(path)) and path in update_mtimes - - else: - link_filter = split_filter - result = vstagedir.import_files( - files_vdir, filter_callback=link_filter, report_written=True, can_link=True + files_vdir, filter_callback=split_filter, report_written=True, can_link=True ) - if update_mtimes: - copy_result = vstagedir.import_files( - files_vdir, filter_callback=copy_filter, report_written=True, update_mtime=time.time() - ) - result = result.combine(copy_result) - return result def stage_dependency_artifacts( -- cgit v1.2.1