diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-02-07 14:41:11 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-02-23 18:47:10 +0800 |
commit | a87e79d9d64a73f1c8368e2b7f309954271c69a7 (patch) | |
tree | 570ee509fa22fe9dfac3fca118bfe02aa946b3c9 /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | ffcec664ca2d97066f5f47f7e3abd85171f91641 (diff) | |
download | edk2-a87e79d9d64a73f1c8368e2b7f309954271c69a7.tar.gz edk2-a87e79d9d64a73f1c8368e2b7f309954271c69a7.tar.bz2 edk2-a87e79d9d64a73f1c8368e2b7f309954271c69a7.zip |
BaseTools: Add check for INF statement must be a .inf file
Per FDF spec, INF statement must use a .inf file, we add this error
check.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 0190be884a..44a3564c7c 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1,7 +1,7 @@ ## @file
# parse FDF file
#
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>
#
# This program and the accompanying materials
@@ -2486,6 +2486,8 @@ class FdfParser: if not self.__GetNextToken():
raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)
ffsInf.InfFileName = self.__Token
+ if not ffsInf.InfFileName.endswith('.inf'):
+ raise Warning("expected .inf file path", self.FileName, self.CurrentLineNumber)
ffsInf.CurrentLineNum = self.CurrentLineNumber
ffsInf.CurrentLineContent = self.__CurrentLine()
|