diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2018-02-06 16:18:58 +0000 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2018-02-13 19:15:05 +0000 |
commit | b1eefbad78f4a2a923c345d1b53d2f8c631bd80b (patch) | |
tree | 255f25fb77fc5b10c2a460077bf2e5f0a7d6d139 | |
parent | 75748c29a13dc9ce033aadf54174cc97de45c14d (diff) | |
download | ybd-b1eefbad78f4a2a923c345d1b53d2f8c631bd80b.tar.gz |
Include build-depends cache-keys as a list in hash factors
Previous behaviour saved cache-keys by component path. If the path of
a morph were modified, but not it's contents, the cache-keys of the
components reverse-depends would change.
Save the cache-keys of the build dependencies as a list instead,
ignoring the path.
-rw-r--r-- | ybd/cache.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ybd/cache.py b/ybd/cache.py index b12d0f3..473303c 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -90,9 +90,6 @@ def cache_key(dn): def hash_factors(dn): hash_factors = {'arch': app.config['arch']} - for factor in dn.get('build-depends', []): - hash_factors[factor] = cache_key(factor) - for factor in dn.get('contents', []): hash_factors[factor.keys()[0]] = cache_key(factor.keys()[0]) @@ -146,6 +143,15 @@ def hash_factors(dn): if dn.get('rpm-metadata'): hash_factors['rpm-metadata'] = dn['rpm-metadata'] + if artifact_version in range(0, 12): + for factor in dn.get('build-depends', []): + hash_factors[factor] = cache_key(factor) + else: + build_depends = [cache_key(bd) for bd in + dn.get('build-depends', [])] + if build_depends: + hash_factors['build-depends'] = build_depends + return hash_factors |