]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Add check for INF statement must be a .inf file
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 7 Feb 2018 06:41:11 +0000 (14:41 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 23 Feb 2018 10:47:10 +0000 (18:47 +0800)
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>
BaseTools/Source/Python/GenFds/FdfParser.py

index 0190be884a339fbe8b98720e596081a50f12513d..44a3564c7c1d0f00d25e805137ceca6008ad603b 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # parse FDF file\r
 #\r
-#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
 #\r
 #  This program and the accompanying materials\r
@@ -2486,6 +2486,8 @@ class FdfParser:
         if not self.__GetNextToken():\r
             raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)\r
         ffsInf.InfFileName = self.__Token\r
+        if not ffsInf.InfFileName.endswith('.inf'):\r
+            raise Warning("expected .inf file path", self.FileName, self.CurrentLineNumber)\r
 \r
         ffsInf.CurrentLineNum = self.CurrentLineNumber\r
         ffsInf.CurrentLineContent = self.__CurrentLine()\r