diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-23 18:47:40 +0100 |
---|---|---|
committer | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-28 12:54:49 +0000 |
commit | a38df13b15b6d5c1610b53a5bd7e6f966a0d9000 (patch) | |
tree | 0f7e559a3d166c741f501afb89ca66607bca55c2 | |
parent | 85cf4a3b4520468534e31c4c4b4108035e0422ab (diff) | |
download | buildstream-a38df13b15b6d5c1610b53a5bd7e6f966a0d9000.tar.gz |
local.py: use extended API, set BST_NO_PRESTAGE_KEY
-rw-r--r-- | src/buildstream/plugins/sources/local.py | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/buildstream/plugins/sources/local.py b/src/buildstream/plugins/sources/local.py index e28098c38..98f74c16c 100644 --- a/src/buildstream/plugins/sources/local.py +++ b/src/buildstream/plugins/sources/local.py @@ -46,6 +46,7 @@ class LocalSource(Source): # pylint: disable=attribute-defined-outside-init BST_STAGE_VIRTUAL_DIRECTORY = True + BST_NO_PRESTAGE_KEY = True def __init__(self, context, project, meta): super().__init__(context, project, meta) @@ -61,20 +62,6 @@ class LocalSource(Source): def preflight(self): pass - def get_unique_key(self): - if self.__unique_key is None: - # Get a list of tuples of the the project relative paths and fullpaths - if os.path.isdir(self.fullpath): - filelist = utils.list_relative_paths(self.fullpath) - filelist = [(relpath, os.path.join(self.fullpath, relpath)) for relpath in filelist] - else: - filelist = [(self.path, self.fullpath)] - - # Return a list of (relative filename, sha256 digest) tuples, a sorted list - # has already been returned by list_relative_paths() - self.__unique_key = [(relpath, unique_key(fullpath)) for relpath, fullpath in filelist] - return self.__unique_key - def get_consistency(self): return Consistency.CACHED @@ -110,20 +97,6 @@ class LocalSource(Source): return self.fullpath -# Create a unique key for a file -def unique_key(filename): - - # Return some hard coded things for files which - # have no content to calculate a key for - if os.path.islink(filename): - # For a symbolic link, use the link target as its unique identifier - return os.readlink(filename) - elif os.path.isdir(filename): - return "0" - - return utils.sha256sum(filename) - - # Plugin entry point def setup(): return LocalSource |