diff options
author | devcurmudgeon <paul.sherwood@codethink.co.uk> | 2018-02-14 11:09:17 +0000 |
---|---|---|
committer | devcurmudgeon <paul.sherwood@codethink.co.uk> | 2018-02-14 11:09:17 +0000 |
commit | b406aec7c0d54e8e525f35de213ef98c6eee9071 (patch) | |
tree | c8d9c8660d7188de221cf6b73690cc31fc97a680 | |
parent | 75748c29a13dc9ce033aadf54174cc97de45c14d (diff) | |
parent | 12035ff8bdaf949a65b21e700cc864b35ec0f4fe (diff) | |
download | ybd-b406aec7c0d54e8e525f35de213ef98c6eee9071.tar.gz |
Merge branch 'benbrown/prefix-and-bd-renames' into 'master'
Add prefix to cache-key and don't change cache-keys when a morph changes directory
See merge request baserock/ybd!403
-rw-r--r-- | ybd/cache.py | 15 | ||||
-rw-r--r-- | ybd/config/ybd.conf | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/ybd/cache.py b/ybd/cache.py index b12d0f3..b4f5e27 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,18 @@ 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 + + if dn.get('prefix'): + hash_factors['prefix'] = dn['prefix'] + return hash_factors diff --git a/ybd/config/ybd.conf b/ybd/config/ybd.conf index d9ac612..9b13936 100644 --- a/ybd/config/ybd.conf +++ b/ybd/config/ybd.conf @@ -65,7 +65,9 @@ aliases: # 9: (after 035c988e) fixed get_tree() to use sha if it exists, before ref # 10: (after 2bdd743) Add 'rpm-metadata' in cache-key # 11: (after bd721e8) Fix potentially incorrect checkout of ref instead of sha -artifact-version: 11 +# 12: (after b1eefba and 33a3553) build-depends file renames don't cause +# cache-key changes and cache_key now includes prefix +artifact-version: 12 # path to be used in default chroots for builds base-path: ['/usr/bin', '/bin', '/usr/sbin', '/sbin'] |