mirror of https://github.com/acidanthera/audk.git
.pytool/EccCheck: Trim leading path to modified directory
The code changes in the patch is for trimming the leading path to the modified directory in the .pytool/EccCheck script. This is necessary when running Ecc on other repositories, such as edk2-platforms, where the platform package is located in a subfolder, like Platform/AMD/AmdPlatformPkg. The EccCheck script checks for modified directories and expects them to start with the package name. # # Skip directory names that do not start with the package being scanned. # if file_dir.split('/')[0] != pkg: continue However, if the package name is in a subfolder, the "git diff" command gives a relative path, like Platform/AMD, which causes the condition to be false. "M Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/Logo.c" As a result, EccCheck does not happen on modified files. To fix this issue, the leading path needs to be trimmed so that it starts from the directory name. This change will not affect the existing check for the edk2 repository, where all package names are at the first level directory. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Joey Vagedes <joey.vagedes@gmail.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
This commit is contained in:
parent
1328938560
commit
9a4088777f
|
@ -182,6 +182,11 @@ class EccCheck(ICiBuildPlugin):
|
|||
#
|
||||
file_dir = os.path.dirname(file_path[-1])
|
||||
#
|
||||
# strip the prefix path till the package name
|
||||
#
|
||||
if pkg in file_dir:
|
||||
file_dir = file_dir[file_dir.find(pkg):]
|
||||
#
|
||||
# Skip directory names that do not start with the package being scanned.
|
||||
#
|
||||
if file_dir.split('/')[0] != pkg:
|
||||
|
|
Loading…
Reference in New Issue