public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete
@ 2020-03-16 17:32 Nate DeSimone
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name Nate DeSimone
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nate DeSimone @ 2020-03-16 17:32 UTC (permalink / raw)
  To: devel; +Cc: Ashley DeSimone, Puja Pandya, Erik Bjorge, Bret Barkelew

If a VendorCustomizer is being used, the EdkRepo installer erroneously
lists every version of Python as obsolete even though they are not.

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs b/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
index 622d7ad..da49006 100644
--- a/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
+++ b/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
@@ -250,7 +250,7 @@ namespace TianoCore.EdkRepoInstaller
                             NewObsoletedPythonVersions.Add(new PythonVersion(version));
                         }
                         PythonVersions = NewPythonVersions;
-                        ObsoletedPythonVersions = NewPythonVersions;
+                        ObsoletedPythonVersions = NewObsoletedPythonVersions;
                     };
                 }
             }
-- 
2.24.0.windows.2


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

* [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name.
  2020-03-16 17:32 [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Nate DeSimone
@ 2020-03-16 17:32 ` Nate DeSimone
  2020-03-17 21:43   ` Desimone, Ashley E
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer Nate DeSimone
  2020-03-17 21:42 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Desimone, Ashley E
  2 siblings, 1 reply; 6+ messages in thread
From: Nate DeSimone @ 2020-03-16 17:32 UTC (permalink / raw)
  To: devel; +Cc: Ashley DeSimone, Puja Pandya, Erik Bjorge, Bret Barkelew

pip does not support '_' in package names and converts them to
'-' after installing the wheel. In order to uninstall affected
packages the '_' needs to be converted to a '-' when calculating
the package name.

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/InstallWorker.cs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
index 5a358f9..f9738fd 100644
--- a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
+++ b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
@@ -550,10 +550,16 @@ namespace TianoCore.EdkRepoInstaller
             {
                 if (VendorCustomizer.Instance.GetPythonWheelsToUninstall != null)
                 {
-                    return VendorCustomizer.Instance.GetPythonWheelsToUninstall();
+                    //
+                    // pip doesn't understand the difference between '_' and '-'
+                    //
+                    return VendorCustomizer.Instance.GetPythonWheelsToUninstall().Select(p => p.Replace('_', '-'));
                 }
             }
-            return new string[] { InstallerStrings.EdkrepoPackageName };
+            //
+            // pip doesn't understand the difference between '_' and '-'
+            //
+            return (new string[] { InstallerStrings.EdkrepoPackageName }).Select(p => p.Replace('_', '-'));
         }
 
         public void PerformInstall(Action<bool, bool> ReportComplete, Action<int> ReportProgress, Action<bool> AllowCancel, Func<bool> CancelPending)
-- 
2.24.0.windows.2


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

* [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer
  2020-03-16 17:32 [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Nate DeSimone
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name Nate DeSimone
@ 2020-03-16 17:32 ` Nate DeSimone
  2020-03-17 21:44   ` Desimone, Ashley E
  2020-03-17 21:42 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Desimone, Ashley E
  2 siblings, 1 reply; 6+ messages in thread
From: Nate DeSimone @ 2020-03-16 17:32 UTC (permalink / raw)
  To: devel; +Cc: Ashley DeSimone, Puja Pandya, Erik Bjorge, Bret Barkelew

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/App.xaml.cs      | 4 ++--
 edkrepo_installer/EdkRepoInstaller/InstallWorker.cs | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/App.xaml.cs b/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
index 58186c9..5d23624 100644
--- a/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
+++ b/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
@@ -185,7 +185,7 @@ namespace TianoCore.EdkRepoInstaller
                 {
                     InstallLogger.Log(string.Format("{0} is a third party version of {1}. {0} is already installed.", DisplayName, ProductName));
                     InstallLogger.Log(string.Format("To install this version of {1}, {0} must be uninstalled first.", DisplayName, ProductName));
-                    SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                    SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                     p.WaitForExit();
                     Thread.Sleep(4000);
                 }
@@ -200,7 +200,7 @@ namespace TianoCore.EdkRepoInstaller
                         );
                     if (Uninstall == MessageBoxResult.Yes)
                     {
-                        SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                        SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                         p.WaitForExit();
                         Thread.Sleep(1000);
                     }
diff --git a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
index 5a358f9..c37189b 100644
--- a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
+++ b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
@@ -672,7 +672,7 @@ namespace TianoCore.EdkRepoInstaller
                         {
                             InstallLogger.Log(string.Format("Uninstalling {0}...", UninstallerPath));
                             string UninstallString = string.Format("\"{0}\" /Uninstall /Passive", UninstallerPath);
-                            SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                            SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                             p.WaitForExit();
                             Thread.Sleep(4000);
                         }
-- 
2.24.0.windows.2


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

* Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete
  2020-03-16 17:32 [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Nate DeSimone
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name Nate DeSimone
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer Nate DeSimone
@ 2020-03-17 21:42 ` Desimone, Ashley E
  2 siblings, 0 replies; 6+ messages in thread
From: Desimone, Ashley E @ 2020-03-17 21:42 UTC (permalink / raw)
  To: Desimone, Nathaniel L, devel@edk2.groups.io
  Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew

Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com> 
Sent: Monday, March 16, 2020 10:33 AM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete

If a VendorCustomizer is being used, the EdkRepo installer erroneously lists every version of Python as obsolete even though they are not.

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs b/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
index 622d7ad..da49006 100644
--- a/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
+++ b/edkrepo_installer/EdkRepoInstaller/VendorCustomizer.cs
@@ -250,7 +250,7 @@ namespace TianoCore.EdkRepoInstaller
                             NewObsoletedPythonVersions.Add(new PythonVersion(version));
                         }
                         PythonVersions = NewPythonVersions;
-                        ObsoletedPythonVersions = NewPythonVersions;
+                        ObsoletedPythonVersions = 
+ NewObsoletedPythonVersions;
                     };
                 }
             }
--
2.24.0.windows.2


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

* Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name.
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name Nate DeSimone
@ 2020-03-17 21:43   ` Desimone, Ashley E
  0 siblings, 0 replies; 6+ messages in thread
From: Desimone, Ashley E @ 2020-03-17 21:43 UTC (permalink / raw)
  To: Desimone, Nathaniel L, devel@edk2.groups.io
  Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew

Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com> 
Sent: Monday, March 16, 2020 10:33 AM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name.

pip does not support '_' in package names and converts them to '-' after installing the wheel. In order to uninstall affected packages the '_' needs to be converted to a '-' when calculating the package name.

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/InstallWorker.cs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
index 5a358f9..f9738fd 100644
--- a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
+++ b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
@@ -550,10 +550,16 @@ namespace TianoCore.EdkRepoInstaller
             {
                 if (VendorCustomizer.Instance.GetPythonWheelsToUninstall != null)
                 {
-                    return VendorCustomizer.Instance.GetPythonWheelsToUninstall();
+                    //
+                    // pip doesn't understand the difference between '_' and '-'
+                    //
+                    return 
+ VendorCustomizer.Instance.GetPythonWheelsToUninstall().Select(p => 
+ p.Replace('_', '-'));
                 }
             }
-            return new string[] { InstallerStrings.EdkrepoPackageName };
+            //
+            // pip doesn't understand the difference between '_' and '-'
+            //
+            return (new string[] { InstallerStrings.EdkrepoPackageName 
+ }).Select(p => p.Replace('_', '-'));
         }
 
         public void PerformInstall(Action<bool, bool> ReportComplete, Action<int> ReportProgress, Action<bool> AllowCancel, Func<bool> CancelPending)
--
2.24.0.windows.2


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

* Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer
  2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer Nate DeSimone
@ 2020-03-17 21:44   ` Desimone, Ashley E
  0 siblings, 0 replies; 6+ messages in thread
From: Desimone, Ashley E @ 2020-03-17 21:44 UTC (permalink / raw)
  To: Desimone, Nathaniel L, devel@edk2.groups.io
  Cc: Pandya, Puja, Bjorge, Erik C, Bret Barkelew

Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com> 
Sent: Monday, March 16, 2020 10:33 AM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer

Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 edkrepo_installer/EdkRepoInstaller/App.xaml.cs      | 4 ++--
 edkrepo_installer/EdkRepoInstaller/InstallWorker.cs | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/edkrepo_installer/EdkRepoInstaller/App.xaml.cs b/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
index 58186c9..5d23624 100644
--- a/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
+++ b/edkrepo_installer/EdkRepoInstaller/App.xaml.cs
@@ -185,7 +185,7 @@ namespace TianoCore.EdkRepoInstaller
                 {
                     InstallLogger.Log(string.Format("{0} is a third party version of {1}. {0} is already installed.", DisplayName, ProductName));
                     InstallLogger.Log(string.Format("To install this version of {1}, {0} must be uninstalled first.", DisplayName, ProductName));
-                    SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                    SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                     p.WaitForExit();
                     Thread.Sleep(4000);
                 }
@@ -200,7 +200,7 @@ namespace TianoCore.EdkRepoInstaller
                         );
                     if (Uninstall == MessageBoxResult.Yes)
                     {
-                        SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                        SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                         p.WaitForExit();
                         Thread.Sleep(1000);
                     }
diff --git a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
index 5a358f9..c37189b 100644
--- a/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
+++ b/edkrepo_installer/EdkRepoInstaller/InstallWorker.cs
@@ -672,7 +672,7 @@ namespace TianoCore.EdkRepoInstaller
                         {
                             InstallLogger.Log(string.Format("Uninstalling {0}...", UninstallerPath));
                             string UninstallString = string.Format("\"{0}\" /Uninstall /Passive", UninstallerPath);
-                            SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/c \"{0}\"", UninstallString));
+                            SilentProcess p = SilentProcess.StartConsoleProcessSilently("cmd.exe", string.Format("/S /C \"{0}\"", UninstallString));
                             p.WaitForExit();
                             Thread.Sleep(4000);
                         }
-- 
2.24.0.windows.2


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

end of thread, other threads:[~2020-03-17 21:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-16 17:32 [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Nate DeSimone
2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Uninstaller does not uninstall packages with '_' in their name Nate DeSimone
2020-03-17 21:43   ` Desimone, Ashley E
2020-03-16 17:32 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Use /S switch to pass command args in installer Nate DeSimone
2020-03-17 21:44   ` Desimone, Ashley E
2020-03-17 21:42 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Installer would lists every Python version as obsolete Desimone, Ashley E

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