From nobody Sun May 5 03:50:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52080+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52080+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1575971791; cv=none; d=zohomail.com; s=zohoarc; b=Kr0BzlpYGykERru1p1ZY6NOM0mSEuUMS2crpfjIY4MeVFEajk6McGeU/O5l12/4MtiysaAS9osWqnuryQp72DITMtc3Dk7BeM1E5pG8xvwkvqjFdImj/eLN3le2aQwwC5LLVzJyzypBuDfVuKayVAV2b5IDK6JOY/GryK0YJuCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575971791; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=lWmLB/rEQqTLBkXfuEZ2yGkSDDznkKa4gBmb0SCb5ss=; b=VjN30Q9GuL5caA85gnaDDwH04POQCAc2Geuzedk+vdJkgDhBTGzcEbxbxMIKBJOVBfz5M03NpDVNmvZcMTwMLlg1+s/viKJmtHifPX1xuWyFRo6zCm7Aee67DOhTcZM+c55cir3GyuVnV0WQijcVV+WhEyj/83NaGUGpQ2Bks5Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52080+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1575971791701170.83596139807503; Tue, 10 Dec 2019 01:56:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id S0QTYY1788612xSiJKU0ql0n; Tue, 10 Dec 2019 01:56:30 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.7869.1575971790156425445 for ; Tue, 10 Dec 2019 01:56:30 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2019 01:56:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,299,1571727600"; d="scan'208";a="238057522" X-Received: from klmarek-mobl.amr.corp.intel.com ([10.252.198.171]) by fmsmga004.fm.intel.com with ESMTP; 10 Dec 2019 01:56:29 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley DeSimone , Puja Pandya , Bret Barkelew Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Support uninstalling packages with '_' in their name. Date: Tue, 10 Dec 2019 01:56:22 -0800 Message-Id: <20191210095622.89893-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com X-Gm-Message-State: MkqFj5WUkxeCZ3iHgCXUAO1dx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1575971790; bh=q9I9GuDV77NfQdzT7gBXykNtKgCoyXh9jBMRlrav7DA=; h=Cc:Date:From:Reply-To:Subject:To; b=AtZdzU5mXxc+DfuQKsnE6Y79ewI5LxjirFieBsvjS7fmjWBBiXar2wNQStSTJ5Uz5wo 0PppkD9jcqH/5PyocKnEvTuPO0dlrwVhApBCFS3W81QNOjriPTqymfNSJA4OHf8AmSM6R vcrpwfxKEWufhAGlMsk6FkxdRJrqnlLW+Zg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Cc: Puja Pandya Cc: Bret Barkelew Signed-off-by: Nate DeSimone Reviewed-by: Ashley 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 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52080): https://edk2.groups.io/g/devel/message/52080 Mute This Topic: https://groups.io/mt/67968737/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-