From nobody Sat Nov 2 12:35:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488873689895595.6927489537401; Tue, 7 Mar 2017 00:01:29 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A6EA28034A; Tue, 7 Mar 2017 00:01:28 -0800 (PST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 DC32F80349 for ; Tue, 7 Mar 2017 00:01:27 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 07 Mar 2017 00:01:27 -0800 Received: from tiano01.ccr.corp.intel.com ([10.239.9.111]) by orsmga003.jf.intel.com with ESMTP; 07 Mar 2017 00:01:26 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,257,1484035200"; d="scan'208";a="941449613" From: hesschen To: edk2-devel@lists.01.org Date: Tue, 7 Mar 2017 16:01:25 +0800 Message-Id: <1488873685-16456-1-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [edk2] [patch] BaseTools/UPT: Fix an issue of adding Event twice 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fix the issue of after installing a package the Event information is duplic= ated. The tool checks if the EVENT information existing in UserExtension or= not. If already existing in UserExtension the tool will not add additional= information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | 18 ++++++++++++---= --- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTo= ols/Source/Python/UPT/GenMetaFile/GenInfFile.py index c1362e6..bb8a120 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -2,7 +2,7 @@ # # This file contained the logical of transfer package object to INF files. # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made availa= ble=20 # under the terms and conditions of the BSD License which accompanies this=20 @@ -169,15 +169,16 @@ def ModuleToInf(ModuleObject, PackageObject=3DNone, D= istHeader=3DNone): Content +=3D GenGuidSections(ModuleObject.GetGuidList()) Content +=3D GenBinaries(ModuleObject) Content +=3D GenDepex(ModuleObject) - Content +=3D GenUserExtensions(ModuleObject) + __UserExtensionsContent =3D GenUserExtensions(ModuleObject) + Content +=3D __UserExtensionsContent if ModuleObject.GetEventList() or ModuleObject.GetBootModeList() or Mo= duleObject.GetHobList(): Content +=3D '\n' # # generate [Event], [BootMode], [Hob] section # - Content +=3D GenSpecialSections(ModuleObject.GetEventList(), 'Event') - Content +=3D GenSpecialSections(ModuleObject.GetBootModeList(), 'BootM= ode') - Content +=3D GenSpecialSections(ModuleObject.GetHobList(), 'Hob') + Content +=3D GenSpecialSections(ModuleObject.GetEventList(), 'Event', = __UserExtensionsContent) + Content +=3D GenSpecialSections(ModuleObject.GetBootModeList(), 'BootM= ode', __UserExtensionsContent) + Content +=3D GenSpecialSections(ModuleObject.GetHobList(), 'Hob', __Us= erExtensionsContent) SaveFileOnChange(ContainerFile, Content, False) if DistHeader.ReadOnly: os.chmod(ContainerFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH) @@ -979,7 +980,7 @@ def GenAsBuiltPcdExSections(ModuleObject): ## GenSpecialSections # generate special sections for Event/BootMode/Hob # -def GenSpecialSections(ObjectList, SectionName): +def GenSpecialSections(ObjectList, SectionName, UserExtensionsContent=3D''= ): # # generate section # @@ -1002,6 +1003,11 @@ def GenSpecialSections(ObjectList, SectionName): else: assert(SectionName) Usage =3D Obj.GetUsage() + + # If the content already in UserExtensionsContent then ignore + if '[%s]' % SectionName in UserExtensionsContent and Type in UserE= xtensionsContent: + return '' + Statement =3D ' ' + Type + ' ## ' + Usage if CommentStr in ['#\n', '#\n#\n']: CommentStr =3D '#\n#\n#\n' --=20 2.7.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel