blob: ed30bbd98d960ee0d603c3ae1b29ee5e65c01a1b [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001# Gather existing and candidate postinst intercepts from BBPATH
2POSTINST_INTERCEPTS_DIR ?= "${COREBASE}/scripts/postinst-intercepts"
3POSTINST_INTERCEPTS_PATHS ?= "${@':'.join('%s/postinst-intercepts' % p for p in '${BBPATH}'.split(':'))}:${POSTINST_INTERCEPTS_DIR}"
4
5python find_intercepts() {
6 intercepts = {}
7 search_paths = []
8 paths = d.getVar('POSTINST_INTERCEPTS_PATHS').split(':')
9 overrides = (':' + d.getVar('FILESOVERRIDES')).split(':') + ['']
10 search_paths = [os.path.join(p, op) for p in paths for op in overrides]
11 searched = oe.path.which_wild('*', ':'.join(search_paths), candidates=True)
12 files, chksums = [], []
13 for pathname, candidates in searched:
14 if os.path.isfile(pathname):
15 files.append(pathname)
16 chksums.append('%s:True' % pathname)
17 chksums.extend('%s:False' % c for c in candidates[:-1])
18
19 d.setVar('POSTINST_INTERCEPT_CHECKSUMS', ' '.join(chksums))
20 d.setVar('POSTINST_INTERCEPTS', ' '.join(files))
21}
22find_intercepts[eventmask] += "bb.event.RecipePreFinalise"
23addhandler find_intercepts