blob: 77c266e946f6ebad2a878b2b136abce934682379 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# Provide some extensions to sanity.bbclass to handle poky-specific conf file upgrades
2
3python poky_update_bblayersconf() {
4 current_version = int(d.getVar('LCONF_VERSION', True) or -1)
5 latest_version = int(d.getVar('LAYER_CONF_VERSION', True) or -1)
6
7 bblayers_fn = bblayers_conf_file(d)
8 lines = sanity_conf_read(bblayers_fn)
9
10 if current_version == 5 and latest_version > 5:
11 # Handle split out of meta-yocto-bsp from meta-yocto
12 if '/meta-yocto-bsp' not in d.getVar('BBLAYERS', True):
13 index, meta_yocto_line = sanity_conf_find_line('meta-yocto\s*\\\\\\n', lines)
14 if meta_yocto_line:
15 lines.insert(index + 1, meta_yocto_line.replace('meta-yocto',
16 'meta-yocto-bsp'))
17 else:
18 sys.exit()
19
20 current_version += 1
21 sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_version)
22 return
23
24 sys.exit()
25}
26
27# Prepend to ensure our function runs before the OE-Core one
28BBLAYERS_CONF_UPDATE_FUNCS =+ "poky_update_bblayersconf"