summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-01-10 22:31:49 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-01-10 22:36:06 +0900
commitfa583bfda24a4f1abad375ad7f0db86da76b6d8f (patch)
tree26231f78ea544082ef066c0a3954f53527a591bb
parentc459dbc8ebbb7c9b727adc5e40c2c6522edf2c06 (diff)
downloadbuildstream-fa583bfda24a4f1abad375ad7f0db86da76b6d8f.tar.gz
plugins/sources/local.py: Consider symbolic link target in cache key.
Technically this breaks cache keys for the local source, but as this comes in a branch which fixes local source cache keys to be stable (they were random before this branch), we wont bother with considering this enhancement a separate API break, the cache key breakage was inescapable anyway.
-rw-r--r--buildstream/plugins/sources/local.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/buildstream/plugins/sources/local.py b/buildstream/plugins/sources/local.py
index 830df873f..4f4a7b8e3 100644
--- a/buildstream/plugins/sources/local.py
+++ b/buildstream/plugins/sources/local.py
@@ -106,7 +106,8 @@ def unique_key(filename):
if os.path.isdir(filename):
return "0"
elif os.path.islink(filename):
- return "1"
+ # For a symbolic link, use the link target as it's unique identifier
+ return os.readlink(filename)
return utils.sha256sum(filename)