Fix set_copyright on Windows.

Change-Id: Iedce0aa822f069ec1bca2d2e76e14da64c62f5bd
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
This commit is contained in:
Pawel Cieslak
2020-01-24 11:04:45 +01:00
committed by sys_ocldev
parent 2ae6556bf2
commit 4d36054254
3 changed files with 32 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018-2019 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -24,13 +24,24 @@ def is_banned(path):
'third_party'
]
banned_files = [
'scripts/lint/set_copyright.sh'
]
path_banned = False
dirname = os.path.dirname(path)
for banned_path in banned_paths:
if dirname.startswith(banned_path):
for banned_file in banned_files:
if os.path.normpath(path) == os.path.normpath(banned_file):
path_banned = True
break
if not path_banned:
dirname = os.path.dirname(path)
for banned_path in banned_paths:
if dirname.startswith(banned_path):
path_banned = True
break
return path_banned