Skip to content

Commit

Permalink
xed_mbuild.py: fix header tagging of python files
Browse files Browse the repository at this point in the history
Change-Id: Ib45191c964ca0d40a3db756ebdc6125ef17d2e35
(cherry picked from commit bcee6d17310203d05c4f3d7a7891f9bd115a0ea5)
  • Loading branch information
mjcharne authored and markcharney committed Feb 14, 2018
1 parent d2c9952 commit 6170f71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pysrc/chipmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2017 Intel Corporation
#Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
26 changes: 11 additions & 15 deletions xed_mbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2017 Intel Corporation
#Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -389,20 +389,20 @@ def legal_header_tagging(env):
if 'apply-header' not in env['targets']:
return

public_source_files = [
source_files = [
mbuild.join(env['src_dir'],'include', 'public', '*.h'),
mbuild.join(env['src_dir'],'examples','*.cpp'),
mbuild.join(env['src_dir'],'examples','*.c'),
mbuild.join(env['src_dir'],'examples','*.[hH]'),
mbuild.join(mbuild.join(env['build_dir'],'*.h')) ]

private_source_files = [
mbuild.join(mbuild.join(env['build_dir'],'*.h')),
mbuild.join(env['src_dir'],'src','*.c'),
mbuild.join(env['src_dir'],'include', 'private','*.h') ]

private_data_files = [
data_files = [
mbuild.join(env['src_dir'],'examples','*.py'),
mbuild.join(env['src_dir'],'scripts','*.py'),
mbuild.join(env['src_dir'],'pysrc','*.py')]
mbuild.join(env['src_dir'],'pysrc','*.py'),
mbuild.join(env['src_dir'],'*.py') ]

# find and classify the files in datafiles directories
for root,dirs,files in os.walk( mbuild.join(env['src_dir'],'datafiles') ):
Expand All @@ -413,22 +413,18 @@ def legal_header_tagging(env):
# skip backup files
continue
elif re.search(r'[.][ch]$',fn):
private_source_files.append(fn)
source_files.append(fn)
else:
private_data_files.append(fn)
data_files.append(fn)

if env.on_windows():
xbc.cdie("ERROR","TAGGING THE IN-USE PYTHON FILES DOES " +
"NOT WORK ON WINDOWS.")

legal_header = open(mbuild.join(env['src_dir'],'misc',
'apache-header.txt'), 'r').readlines()
header_tag_files(env,public_source_files, legal_header,
script_files=False)
header_tag_files(env,private_source_files, legal_header,
script_files=False)
header_tag_files(env, private_data_files, legal_header,
script_files=True)
header_tag_files(env, source_files, legal_header, script_files=False)
header_tag_files(env, data_files, legal_header, script_files=True)
mbuild.msgb("STOPPING", "after %s" % 'header tagging')
xbc.cexit(0)

Expand Down

0 comments on commit 6170f71

Please sign in to comment.