public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Remove EDK_SOURCE keyword from ECC Tool
@ 2019-01-15 11:02 Feng, Bob C
  2019-01-17  1:50 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Feng, Bob C @ 2019-01-15 11:02 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove EDK_SOURCE keyword from ECC Tool.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/Ecc/EccMain.py        | 27 -------------------
 .../Ecc/MetaFileWorkspace/MetaFileParser.py   | 20 --------------
 2 files changed, 47 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
index 5f9e497e37..0f97447751 100644
--- a/BaseTools/Source/Python/Ecc/EccMain.py
+++ b/BaseTools/Source/Python/Ecc/EccMain.py
@@ -66,47 +66,20 @@ class Ecc(object):
 
         # Parse the options and args
         self.ParseOption()
         EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")
 
-        #
-        # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP
-        #
         WorkspaceDir = os.path.normcase(os.path.normpath(os.environ["WORKSPACE"]))
         os.environ["WORKSPACE"] = WorkspaceDir
 
         # set multiple workspace
         PackagesPath = os.getenv("PACKAGES_PATH")
         mws.setWs(WorkspaceDir, PackagesPath)
 
-        if "ECP_SOURCE" not in os.environ:
-            os.environ["ECP_SOURCE"] = mws.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
-        if "EFI_SOURCE" not in os.environ:
-            os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
-        if "EDK_SOURCE" not in os.environ:
-            os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
-
-        #
-        # Unify case of characters on case-insensitive systems
-        #
-        EfiSourceDir = os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))
-        EdkSourceDir = os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))
-        EcpSourceDir = os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))
-
-        os.environ["EFI_SOURCE"] = EfiSourceDir
-        os.environ["EDK_SOURCE"] = EdkSourceDir
-        os.environ["ECP_SOURCE"] = EcpSourceDir
-
         GlobalData.gWorkspace = WorkspaceDir
-        GlobalData.gEfiSource = EfiSourceDir
-        GlobalData.gEdkSource = EdkSourceDir
-        GlobalData.gEcpSource = EcpSourceDir
 
         GlobalData.gGlobalDefines["WORKSPACE"]  = WorkspaceDir
-        GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
-        GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
-        GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir
 
         EdkLogger.info("Loading ECC configuration ... done")
         # Generate checkpoints list
         EccGlobalData.gConfig = Configuration(self.ConfigFile)
 
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 283789fd1d..862974894a 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -608,21 +608,10 @@ class InfParser(MetaFileParser):
             for Index in range(0, len(self._ValueList)):
                 Value = self._ValueList[Index]
                 if not Value:
                     continue
 
-                if Value.upper().find('$(EFI_SOURCE)\Edk'.upper()) > -1 or Value.upper().find('$(EFI_SOURCE)/Edk'.upper()) > -1:
-                    Value = '$(EDK_SOURCE)' + Value[17:]
-                if Value.find('$(EFI_SOURCE)') > -1 or Value.find('$(EDK_SOURCE)') > -1:
-                    pass
-                elif Value.startswith('.'):
-                    pass
-                elif Value.startswith('$('):
-                    pass
-                else:
-                    Value = '$(EFI_SOURCE)/' + Value
-
                 self._ValueList[Index] = ReplaceMacro(Value, Macros)
 
     ## Parse [Sources] section
     #
     #   Only path can have macro used. So we need to replace them before use.
@@ -1357,20 +1346,11 @@ class DscParser(MetaFileParser):
             __IncludeMacros = {}
             #
             # Allow using system environment variables  in path after !include
             #
             __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
-            if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
-                __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
-            #
-            # During GenFds phase call DSC parser, will go into this branch.
-            #
-            elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
-                __IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']
 
-            __IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']
-            __IncludeMacros['EDK_SOURCE'] = GlobalData.gGlobalDefines['EDK_SOURCE']
             #
             # Allow using MACROs comes from [Defines] section to keep compatible.
             #
             __IncludeMacros.update(self._Macros)
 
-- 
2.19.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Remove EDK_SOURCE keyword from ECC Tool
  2019-01-15 11:02 [Patch] BaseTools: Remove EDK_SOURCE keyword from ECC Tool Feng, Bob C
@ 2019-01-17  1:50 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2019-01-17  1:50 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Feng, Bob C
>Sent: Tuesday, January 15, 2019 7:03 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Remove EDK_SOURCE keyword from ECC Tool
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
>Remove EDK_SOURCE keyword from ECC Tool.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/Ecc/EccMain.py        | 27 -------------------
> .../Ecc/MetaFileWorkspace/MetaFileParser.py   | 20 --------------
> 2 files changed, 47 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Ecc/EccMain.py
>b/BaseTools/Source/Python/Ecc/EccMain.py
>index 5f9e497e37..0f97447751 100644
>--- a/BaseTools/Source/Python/Ecc/EccMain.py
>+++ b/BaseTools/Source/Python/Ecc/EccMain.py
>@@ -66,47 +66,20 @@ class Ecc(object):
>
>         # Parse the options and args
>         self.ParseOption()
>         EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime())
>+ "[00:00]" + "\n")
>
>-        #
>-        # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always
>point to ECP
>-        #
>         WorkspaceDir =
>os.path.normcase(os.path.normpath(os.environ["WORKSPACE"]))
>         os.environ["WORKSPACE"] = WorkspaceDir
>
>         # set multiple workspace
>         PackagesPath = os.getenv("PACKAGES_PATH")
>         mws.setWs(WorkspaceDir, PackagesPath)
>
>-        if "ECP_SOURCE" not in os.environ:
>-            os.environ["ECP_SOURCE"] = mws.join(WorkspaceDir,
>GlobalData.gEdkCompatibilityPkg)
>-        if "EFI_SOURCE" not in os.environ:
>-            os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
>-        if "EDK_SOURCE" not in os.environ:
>-            os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
>-
>-        #
>-        # Unify case of characters on case-insensitive systems
>-        #
>-        EfiSourceDir =
>os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))
>-        EdkSourceDir =
>os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))
>-        EcpSourceDir =
>os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))
>-
>-        os.environ["EFI_SOURCE"] = EfiSourceDir
>-        os.environ["EDK_SOURCE"] = EdkSourceDir
>-        os.environ["ECP_SOURCE"] = EcpSourceDir
>-
>         GlobalData.gWorkspace = WorkspaceDir
>-        GlobalData.gEfiSource = EfiSourceDir
>-        GlobalData.gEdkSource = EdkSourceDir
>-        GlobalData.gEcpSource = EcpSourceDir
>
>         GlobalData.gGlobalDefines["WORKSPACE"]  = WorkspaceDir
>-        GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
>-        GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
>-        GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir
>
>         EdkLogger.info("Loading ECC configuration ... done")
>         # Generate checkpoints list
>         EccGlobalData.gConfig = Configuration(self.ConfigFile)
>
>diff --git
>a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>index 283789fd1d..862974894a 100644
>--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>@@ -608,21 +608,10 @@ class InfParser(MetaFileParser):
>             for Index in range(0, len(self._ValueList)):
>                 Value = self._ValueList[Index]
>                 if not Value:
>                     continue
>
>-                if Value.upper().find('$(EFI_SOURCE)\Edk'.upper()) > -1 or
>Value.upper().find('$(EFI_SOURCE)/Edk'.upper()) > -1:
>-                    Value = '$(EDK_SOURCE)' + Value[17:]
>-                if Value.find('$(EFI_SOURCE)') > -1 or Value.find('$(EDK_SOURCE)') >
>-1:
>-                    pass
>-                elif Value.startswith('.'):
>-                    pass
>-                elif Value.startswith('$('):
>-                    pass
>-                else:
>-                    Value = '$(EFI_SOURCE)/' + Value
>-
>                 self._ValueList[Index] = ReplaceMacro(Value, Macros)
>
>     ## Parse [Sources] section
>     #
>     #   Only path can have macro used. So we need to replace them before use.
>@@ -1357,20 +1346,11 @@ class DscParser(MetaFileParser):
>             __IncludeMacros = {}
>             #
>             # Allow using system environment variables  in path after !include
>             #
>             __IncludeMacros['WORKSPACE'] =
>GlobalData.gGlobalDefines['WORKSPACE']
>-            if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
>-                __IncludeMacros['ECP_SOURCE'] =
>GlobalData.gGlobalDefines['ECP_SOURCE']
>-            #
>-            # During GenFds phase call DSC parser, will go into this branch.
>-            #
>-            elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
>-                __IncludeMacros['ECP_SOURCE'] =
>GlobalData.gCommandLineDefines['ECP_SOURCE']
>
>-            __IncludeMacros['EFI_SOURCE'] =
>GlobalData.gGlobalDefines['EFI_SOURCE']
>-            __IncludeMacros['EDK_SOURCE'] =
>GlobalData.gGlobalDefines['EDK_SOURCE']
>             #
>             # Allow using MACROs comes from [Defines] section to keep
>compatible.
>             #
>             __IncludeMacros.update(self._Macros)
>
>--
>2.19.1.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-17  1:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-15 11:02 [Patch] BaseTools: Remove EDK_SOURCE keyword from ECC Tool Feng, Bob C
2019-01-17  1:50 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox