diff options
author | Luis R. Rodriguez <mcgrof@suse.com> | 2014-11-04 15:17:36 -0800 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-11-14 13:47:16 -0800 |
commit | ba068f434f3eb70c89bab2cb434b67432f23ef6d (patch) | |
tree | 4bded0822734af3fb7669fd3870fa7e3bcc45e39 /gentree.py | |
parent | 78ff3844b956cd8940bcb9a00b8102683325f451 (diff) |
backports: add backport version parsing for kernel integration
The way we'll define backports versioning information for
kernel integration is slightly different, we'll rely completely
on Kconfig for the job, but in the end share the same C code
defines.
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-x | gentree.py | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -861,6 +861,24 @@ def process(kerneldir, copy_list_file, git_revision=None, f.write('BACKPORTS_GIT_TRACKED="backport tracker ID: $(shell git rev-parse HEAD 2>/dev/null || echo \'not built in git tree\')"\n') f.close() git_debug_snapshot(args, "add versions files") + else: + kconf_regexes = [ + (re.compile(r'.*(?P<key>%%BACKPORT_DIR%%)'), '%%BACKPORT_DIR%%', 'backports/'), + (re.compile(r'.*(?P<key>%%BACKPORTS_VERSION%%).*'), '%%BACKPORTS_VERSION%%', backports_version), + (re.compile(r'.*(?P<key>%%BACKPORTED_KERNEL_VERSION%%).*'), '%%BACKPORTED_KERNEL_VERSION%%', kernel_version), + (re.compile(r'.*(?P<key>%%BACKPORTED_KERNEL_NAME%%).*'), '%%BACKPORTED_KERNEL_NAME%%', args.base_name), + ] + out = '' + for l in open(os.path.join(bpid.target_dir, 'Kconfig'), 'r'): + for r in kconf_regexes: + m = r[0].match(l) + if m: + l = re.sub(r'(' + r[1] + ')', r'' + r[2] + '', l) + out += l + outf = open(os.path.join(bpid.target_dir, 'Kconfig'), 'w') + outf.write(out) + outf.close() + git_debug_snapshot(args, "modify top level backports/Kconfig with backports identity") if disable_list: # No need to verify_sources() as compat's Kconfig has no 'source' call |