diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-04-08 22:36:24 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-08 22:36:24 +0200 |
commit | 6e0475b599217eceb8e01a1e572c2b16319462d9 (patch) | |
tree | 372e3c99ef1a128599455c91526d2d7c6d7ed790 /gentree.py | |
parent | 8f72dab3d83f89a65b3bc5b141d509c156157503 (diff) |
gentree: add automatic backports only if needed
If the automatic backports aren't selected by any
driver then they don't need to be added to the
output, so ignore them in that case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-x | gentree.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -178,7 +178,12 @@ def automatic_backport_mangle_c_file(name): def add_automatic_backports(args): export = re.compile(r'^EXPORT_SYMBOL(_GPL)?\((?P<sym>[^\)]*)\)') bpi = kconfig.get_backport_info(os.path.join(args.outdir, 'compat', 'Kconfig')) + configtree = kconfig.ConfigTree(os.path.join(args.outdir, 'Kconfig')) + all_selects = configtree.all_selects() for sym, vals in bpi.iteritems(): + if sym.startswith('BACKPORT_BUILD_'): + if not sym[15:] in all_selects: + continue symtype, module_name, c_files, h_files = vals # first copy files @@ -329,9 +334,6 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, git_debug_init(args) - add_automatic_backports(args) - git_debug_snapshot(args, 'Add automatic backports') - if not args.git_revision: copy_files(args.kerneldir, copy_list, args.outdir) else: @@ -343,6 +345,9 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, git_debug_snapshot(args, 'Add driver sources') + add_automatic_backports(args) + git_debug_snapshot(args, 'Add automatic backports') + logwrite('Apply patches ...') patches = [] for root, dirs, files in os.walk(os.path.join(source_dir, 'patches')): |