From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.105.1576110198010147313 for ; Wed, 11 Dec 2019 16:23:18 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ashley.e.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 16:23:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,303,1571727600"; d="scan'208";a="413698960" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by fmsmga005.fm.intel.com with ESMTP; 11 Dec 2019 16:23:17 -0800 Received: from orsmsx152.amr.corp.intel.com (10.22.226.39) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 16:23:16 -0800 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.30]) by ORSMSX152.amr.corp.intel.com ([169.254.8.171]) with mapi id 14.03.0439.000; Wed, 11 Dec 2019 16:23:16 -0800 From: "Desimone, Ashley E" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Pandya, Puja" , Bret Barkelew Subject: Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Support uninstalling packages with '_' in their name. Thread-Topic: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Support uninstalling packages with '_' in their name. Thread-Index: AQHVr0AlVppmMOQocUGzPITwhoFrDqe1phkA Date: Thu, 12 Dec 2019 00:23:16 +0000 Message-ID: <4CF3A9EB60ABDA47BE7821A4DA3A0A3353CC3AF4@ORSMSX116.amr.corp.intel.com> References: <20191210095622.89893-1-nathaniel.l.desimone@intel.com> In-Reply-To: <20191210095622.89893-1-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGM4MGUwNmUtZmIwYy00ZWNmLWJjMmUtZTE4MWNhMjk2Yjg3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVg3RWRaaTlORlM4cGhoTHEzdkhKVWJjdXYwQ2NIbVRpQWhWU09Ic3ZHU0Q1QjJOXC9od290dHNySGJtbTVIWUoifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: ashley.e.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ashley DeSimone -----Original Message----- From: Desimone, Nathaniel L=20 Sent: Tuesday, December 10, 2019 1:56 AM To: devel@edk2.groups.io Cc: Desimone, Ashley E ; Pandya, Puja ; Bret Barkelew Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Support uninstalling packa= ges with '_' in their name. pip does not support '_' in package names and converts them to '-' after in= stalling the wheel. In order to uninstall affected packages the '_' needs t= o be converted to a '-' when calculating the package name. Cc: Ashley DeSimone Cc: Puja Pandya Cc: Bret Barkelew Signed-off-by: Nate DeSimone --- edkrepo_installer/linux-scripts/install.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/edkrepo_installer/linux-scripts/install.py b/edkrepo_installer= /linux-scripts/install.py index a05ce6a..66421ba 100755 --- a/edkrepo_installer/linux-scripts/install.py +++ b/edkrepo_installer/linux-scripts/install.py @@ -93,8 +93,9 @@ def get_required_wheels(): continue installed_modules[name] =3D version for name in ret_val: - if name in installed_modules: - version =3D installed_modules[name] + #pip doesn't understand the difference between '_' and '-' + if name.replace('_','-') in installed_modules: + version =3D installed_modules[name.replace('_','-')] if _check_version(version, ret_val[name]['version']) >=3D 0 an= d not ret_val[name]['uninstall']: ret_val[name]['install'] =3D False else: @@ -294,9 +295,8 @@ def do_install(): log.info('- Missing wheel file directory') return 1 for whl_name in wheels_to_install: - whl =3D wheels_to_install[whl_name]['wheel'] - install_whl =3D wheels_to_install[whl_name]['install'] uninstall_whl =3D wheels_to_install[whl_name]['uninstall'] + whl_name =3D whl_name.replace('_','-') #pip doesn't understan= d the difference between '_' and '-' if uninstall_whl: try: res =3D default_run(['python3', '-m', 'pip', 'uninstal= l', '--yes', whl_name]) @@ -304,6 +304,9 @@ def do_install(): log.info('- Failed to uninstall {}'.format(whl_name)) return 1 log.info('+ Uninstalled {}'.format(whl_name)) + for whl_name in wheels_to_install: + whl =3D wheels_to_install[whl_name]['wheel'] + install_whl =3D wheels_to_install[whl_name]['install'] if install_whl: install_cmd =3D ['python3', '-m', 'pip', 'install'] if args.local: -- 2.20.1