From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Fri, 17 May 2019 05:35:18 -0700 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93B3481DF1; Fri, 17 May 2019 12:34:53 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-94.rdu2.redhat.com [10.10.120.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 278F05D6A9; Fri, 17 May 2019 12:34:49 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] BaseTools:Update mailing list address in BaseTools error messages To: "Fan, ZhijuX" , "devel@edk2.groups.io" Cc: "Gao, Liming" , "Feng, Bob C" References: <8e0736bc-aaed-c401-97b7-fbc4b1aea469@redhat.com> From: "Laszlo Ersek" Message-ID: <5251ef9c-64bf-54ab-8f68-21f2535294b3@redhat.com> Date: Fri, 17 May 2019 14:34:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 17 May 2019 12:35:04 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Zhiju, On 05/17/19 05:07, Fan, ZhijuX wrote: > (2)ExtraData=ST.MSG_SEARCH_FOR_HELP % EDKII_MAIL_ADDR > > I have tried to solve this problem in this way. ST is the collection of all ExtraData information in UPT, > This collection does not exist in other modules, Other modules have only the collection of error message. > All ExtraData information exists as a string, There is no uniform variable like ST to collect this information. > So I created EDKII_MAIL_ADDR to achieve the same effect. You misunderstood me. (a) The definition of EDKII_MAIL_ADDR is fine. (b) The way you consume EDKII_MAIL_ADDR in "GenFds.py", "Trim.py", and "build.py", is also fine. (c) The way you hardwire the email address "devel@edk2.groups.io" in "StringTable.py" is not fine. Rather than directly embedding the email address in MSG_SEARCH_FOR_HELP, you should change MSG_SEARCH_FOR_HELP to take a string parameter (%s). Then all locations in UPT that refer to MSG_SEARCH_FOR_HELP should be updated to substitute EDKII_MAIL_ADDR for the %s parameter of MSG_SEARCH_FOR_HELP. Let me demonstrate: --------------------- diff --git a/BaseTools/Source/Python/UPT/InstallPkg.py b/BaseTools/Source/Python/UPT/InstallPkg.py index 6cb9f2533df5..0249810b3a9e 100644 --- a/BaseTools/Source/Python/UPT/InstallPkg.py +++ b/BaseTools/Source/Python/UPT/InstallPkg.py @@ -547,7 +547,7 @@ def Main(Options = None): "\nInstallPkg", CODE_ERROR, ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.PackageFile, - ExtraData=ST.MSG_SEARCH_FOR_HELP, + ExtraData=(ST.MSG_SEARCH_FOR_HELP % EDKII_MAIL_ADDR), RaiseError=False ) Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/Source/Python/UPT/Logger/StringTable.py index 59f71d390bef..48321ee0b865 100644 --- a/BaseTools/Source/Python/UPT/Logger/StringTable.py +++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py @@ -317,7 +317,7 @@ MSG_NEW_FILE_NAME_FOR_DIST = _( MSG_UPDATE_PACKAGE_DATABASE = _("Update Distribution Package Database ...") MSG_PYTHON_ON = _("(Python %s on %s) ") MSG_SEARCH_FOR_HELP = _( - "\n(Please send email to edk2-devel@lists.01.org for\n" + "\n(Please send email to %s for\n" " help, attach the following call stack trace.)\n") MSG_REMOVE_TEMP_FILE_STARTED = _("Removing temp files started ... ") MSG_REMOVE_TEMP_FILE_DONE = _("Removing temp files ... Done.") --------------------- Thanks Laszlo >> -----Original Message----- >> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >> Laszlo Ersek >> Sent: Thursday, May 16, 2019 9:17 PM >> To: devel@edk2.groups.io; Fan, ZhijuX >> Cc: Gao, Liming ; Feng, Bob C >> Subject: Re: [edk2-devel] [PATCH] BaseTools:Update mailing list address in >> BaseTools error messages >> >> On 05/16/19 07:11, Fan, ZhijuX wrote: >>> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1815 >>> >>> The edk2 source tree contains four instances of the outdated mailing >>> list address "edk2-devel@lists.01.org". >>> I factoring these out to a new constant, and then setting the constant >>> to "devel@edk2.groups.io". >> >> (1) The commit message should be cleaned up: "Factor these out ... and then >> set ..." >> >> Furthermore: >> >>> >>> Cc: Bob Feng >>> Cc: Liming Gao >>> Signed-off-by: Zhiju.Fan >>> --- >>> BaseTools/Source/Python/Common/DataType.py | 1 + >>> BaseTools/Source/Python/GenFds/GenFds.py | 2 +- >>> BaseTools/Source/Python/Trim/Trim.py | 2 +- >>> BaseTools/Source/Python/UPT/Logger/StringTable.py | 2 +- >>> BaseTools/Source/Python/build/build.py | 2 +- >>> 5 files changed, 5 insertions(+), 4 deletions(-) >>> >>> diff --git a/BaseTools/Source/Python/Common/DataType.py >>> b/BaseTools/Source/Python/Common/DataType.py >>> index 780711bf8e..7f10533345 100644 >>> --- a/BaseTools/Source/Python/Common/DataType.py >>> +++ b/BaseTools/Source/Python/Common/DataType.py >>> @@ -88,6 +88,7 @@ EDK_COMPONENT_TYPE_SAL_RT_DRIVER = >> 'SAL_RT_DRIVER' >>> EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION' >>> EDK_NAME = 'EDK' >>> EDKII_NAME = 'EDKII' >>> +EDKII_MAIL_ADDR = 'devel@edk2.groups.io' >>> >>> COMPONENT_TO_MODULE_MAP_DICT = { >>> EDK_COMPONENT_TYPE_LIBRARY : SUP_MODULE_BASE, >>> diff --git a/BaseTools/Source/Python/GenFds/GenFds.py >>> b/BaseTools/Source/Python/GenFds/GenFds.py >>> index 21ae9c4d4c..bd70aac9f5 100644 >>> --- a/BaseTools/Source/Python/GenFds/GenFds.py >>> +++ b/BaseTools/Source/Python/GenFds/GenFds.py >>> @@ -388,7 +388,7 @@ def GenFdsApi(FdsCommandDict, >> WorkSpaceDataBase=None): >>> "\nPython", >>> CODE_ERROR, >>> "Tools code failure", >>> - ExtraData="Please send email to edk2-devel@lists.01.org for >> help, attaching following call stack trace!\n", >>> + ExtraData="Please send email to %s for help, >>> + attaching following call stack trace!\n" % EDKII_MAIL_ADDR, >>> RaiseError=False >>> ) >>> EdkLogger.quiet(traceback.format_exc()) >>> diff --git a/BaseTools/Source/Python/Trim/Trim.py >>> b/BaseTools/Source/Python/Trim/Trim.py >>> index 6f29f1a35a..573f33772f 100644 >>> --- a/BaseTools/Source/Python/Trim/Trim.py >>> +++ b/BaseTools/Source/Python/Trim/Trim.py >>> @@ -533,7 +533,7 @@ def Main(): >>> "\nTrim", >>> CODE_ERROR, >>> "Unknown fatal error when trimming [%s]" % InputFile, >>> - ExtraData="\n(Please send email to edk2-devel@lists.01.org for >> help, attaching following call stack trace!)\n", >>> + ExtraData="\n(Please send email to %s for help, >>> + attaching following call stack trace!)\n" % EDKII_MAIL_ADDR, >>> RaiseError=False >>> ) >>> EdkLogger.quiet("(Python %s on %s) " % >>> (platform.python_version(), sys.platform) + traceback.format_exc()) >>> diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py >>> b/BaseTools/Source/Python/UPT/Logger/StringTable.py >>> index 59f71d390b..c1eda61d05 100644 >>> --- a/BaseTools/Source/Python/UPT/Logger/StringTable.py >>> +++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py >>> @@ -317,7 +317,7 @@ MSG_NEW_FILE_NAME_FOR_DIST = _( >>> MSG_UPDATE_PACKAGE_DATABASE = _("Update Distribution Package >> Database ...") >>> MSG_PYTHON_ON = _("(Python %s on %s) ") >>> MSG_SEARCH_FOR_HELP = _( >>> - "\n(Please send email to edk2-devel@lists.01.org for\n" >>> + "\n(Please send email to devel@edk2.groups.io for\n" >>> " help, attach the following call stack trace.)\n") >> >> (2) When I filed the BZ, I didn't realize that this instance of the old list address >> was in a localized string / message. >> >> However, the example of MSG_PYTHON_ON shows that such messages can >> take parameters as well. This means that all code locations referencing >> MSG_SEARCH_FOR_HELP will have to be updated -- >> MSG_SEARCH_FOR_HELP should use %s, and all uses of >> MSG_SEARCH_FOR_HELP should pass in EDKII_MAIL_ADDR as a parameter: >> >> $ git grep -l -w MSG_SEARCH_FOR_HELP >> >> Source/Python/UPT/InstallPkg.py >> Source/Python/UPT/InventoryWs.py >> Source/Python/UPT/Logger/StringTable.py >> Source/Python/UPT/MkPkg.py >> Source/Python/UPT/ReplacePkg.py >> Source/Python/UPT/RmPkg.py >> Source/Python/UPT/TestInstall.py >> >> For example, >> >> ExtraData=ST.MSG_SEARCH_FOR_HELP % EDKII_MAIL_ADDR >> >> Thanks >> Laszlo >> >>> MSG_REMOVE_TEMP_FILE_STARTED = _("Removing temp files started ... >> ") >>> MSG_REMOVE_TEMP_FILE_DONE = _("Removing temp files ... Done.") >>> diff --git a/BaseTools/Source/Python/build/build.py >>> b/BaseTools/Source/Python/build/build.py >>> index 7271570d29..0071581c80 100644 >>> --- a/BaseTools/Source/Python/build/build.py >>> +++ b/BaseTools/Source/Python/build/build.py >>> @@ -2480,7 +2480,7 @@ def Main(): >>> "\nbuild", >>> CODE_ERROR, >>> "Unknown fatal error when processing [%s]" % MetaFile, >>> - ExtraData="\n(Please send email to edk2-devel@lists.01.org for >> help, attaching following call stack trace!)\n", >>> + ExtraData="\n(Please send email to %s for help, >>> + attaching following call stack trace!)\n" % EDKII_MAIL_ADDR, >>> RaiseError=False >>> ) >>> EdkLogger.quiet("(Python %s on %s) " % >>> (platform.python_version(), sys.platform) + traceback.format_exc()) >>> >> >> >> >