From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A637781EE5 for ; Fri, 25 Nov 2016 01:21:28 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 25 Nov 2016 01:21:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,546,1473145200"; d="scan'208";a="35421919" Received: from unknown (HELO RTHOMAIY-DESK3.gar.corp.intel.com) ([10.223.165.169]) by fmsmga005.fm.intel.com with ESMTP; 25 Nov 2016 01:21:26 -0800 From: rthomaiy To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Giri P Mudusuru , Richard Thomaiyar Date: Fri, 25 Nov 2016 14:51:06 +0530 Message-Id: <20161125092106.12296-1-richard.marian.thomaiyar@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 09:21:28 -0000 Add PACKAGES_PATH support in GenCfgOpt.py Cc: Maurice Ma Cc: Jiewen Yao Cc: Giri P Mudusuru Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Richard Thomaiyar --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py index 654cdfc..0675b55 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -523,9 +523,13 @@ EndList if Match: IncludeFilePath = Match.group(1) IncludeFilePath = self.ExpandMacros(IncludeFilePath) - try: - IncludeDsc = open(IncludeFilePath, "r") - except: + PackagesPath = os.getenv("PACKAGES_PATH") + for PackagePath in PackagesPath.split(os.pathsep): + IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath)) + if os.path.exists(IncludeFilePathAbs): + IncludeDsc = open(IncludeFilePathAbs, "r") + break + if IncludeDsc == None: print("ERROR: Cannot open file '%s'" % IncludeFilePath) raise SystemExit NewDscLines = IncludeDsc.readlines() -- 2.9.0.windows.1