diff options
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-rw-r--r-- | meta/classes/externalsrc.bbclass | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 5c65d2b742..31908c3ca2 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -103,6 +103,7 @@ python () { | |||
103 | d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") | 103 | d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") |
104 | 104 | ||
105 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') | 105 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') |
106 | d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}') | ||
106 | 107 | ||
107 | # We don't want the workdir to go away | 108 | # We don't want the workdir to go away |
108 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True)) | 109 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True)) |
@@ -166,3 +167,24 @@ def srctree_hash_files(d): | |||
166 | else: | 167 | else: |
167 | ret = d.getVar('EXTERNALSRC', True) + '/*:True' | 168 | ret = d.getVar('EXTERNALSRC', True) + '/*:True' |
168 | return ret | 169 | return ret |
170 | |||
171 | def srctree_configure_hash_files(d): | ||
172 | """ | ||
173 | Get the list of files that should trigger do_configure to re-execute, | ||
174 | based on the value of CONFIGURE_FILES | ||
175 | """ | ||
176 | in_files = (d.getVar('CONFIGURE_FILES', True) or '').split() | ||
177 | out_items = [] | ||
178 | search_files = [] | ||
179 | for entry in in_files: | ||
180 | if entry.startswith('/'): | ||
181 | out_items.append('%s:%s' % (entry, os.path.exists(entry))) | ||
182 | else: | ||
183 | search_files.append(entry) | ||
184 | if search_files: | ||
185 | s_dir = d.getVar('EXTERNALSRC', True) | ||
186 | for root, _, files in os.walk(s_dir): | ||
187 | for f in files: | ||
188 | if f in search_files: | ||
189 | out_items.append('%s:True' % os.path.join(root, f)) | ||
190 | return ' '.join(out_items) | ||