From nobody Sat May 4 17:15:06 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+58902+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+58902+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588967114; cv=none; d=zohomail.com; s=zohoarc; b=A2PswXStsol+fU6QfgqDpPaB9F5RQanqrNVzVmJ5Vtb3nrV8WrvnrMMtZTrujZe0nnl+SVP3edNIAcevMZqFZRGgsjBQlbmpBZokToQQ4mVhHbkPPGf3xAZaN3aQbHSL0ZJnLlEEv9oDCBJOyNSdvGl8KPlgKlMtz3wvWJ88Qlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588967114; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=oM7ZqQcP+4QTRE0gvLe24Zy/CsZplYk0FNev7vUxUew=; b=ihKuGCImZe2GrkI/k263Z3C5IPPmCWJQipexWyL4v9zVFK7S+n7jOySO+krHpp/2ojW40aQd5NdKBMeq3jKIWcCf/ooJU831MxMMq1sAlScqVqYNm1c108NF0SQ42jCkZ646bak8P7eiuYI/PTTjDIBV2MGYLenoADQaXXLLlDE= 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+58902+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 1588967114864901.6687532483995; Fri, 8 May 2020 12:45:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oV5UYY1788612xvuwaOT47Zy; Fri, 08 May 2020 12:45:14 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.2587.1588967113412285201 for ; Fri, 08 May 2020 12:45:13 -0700 IronPort-SDR: fqU2VHFO+q4hyk8zUY+Zh6SBYLKyyvbnRel9hOKzn6DJO8GFNkXBmBQ8dDdvLhLWNn3/Ir8yyf aoxVws/1fT/g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 12:45:12 -0700 IronPort-SDR: sVaaUv+9jJtQ1BN6msOnGJtHQprAHZ0ZSDHzhF1YN1sEtJamkDo/ZKhVYTsilkFrxKsR4aekjU GfaMcEv6U90A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="296243825" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.16.147]) by fmsmga002.fm.intel.com with ESMTP; 08 May 2020 12:45:11 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Address corner cases in find_project_in_all_indices Date: Fri, 8 May 2020 12:45:09 -0700 Message-Id: <20200508194509.10620-1-ashley.e.desimone@intel.com> 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,ashley.e.desimone@intel.com X-Gm-Message-State: HlCQCOwUvdKhbBFmHuDpCfSrx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588967114; bh=2a1TxRqAU2L2xlCTk/1L+54cuQcrFeTWsO5+vcVSBf0=; h=Cc:Date:From:Reply-To:Subject:To; b=iA5/oaGckDV9XwJGi/8D9y46ZE70/EB9ABx5DuOR9BiXeDq8xvaslgMRcPh3vF5dehe dc3/sQUaZBzgujarzUaV9FNd4KHQc2Rhj6YpIe5ogWhsq20C0WR0v8v0ppQZVvQ7+xUgC Xpl+eEbfd5fz1XfYSwIVMg3qoIknK5be/so= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Update find_project_in_all_indices() to only return None values for the source manifest repo and config file if the project is truly not found in any manifest repository. In the case a path to a manifest file is provided recursively call find_in_all_indices() with the code name from the manifest at the provided path to generate the source manifest repo and config values. Additionally update the call to find_project_in_all_indices() in find_source_manifest_repo to use the value of man_repo instead of None. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman Reviewed-by: Nate DeSimone --- .../manifest_repos_maintenance.py | 26 ++++++++++++++++++= +--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index 2a5a70f..08c4fe6 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -185,9 +185,29 @@ def find_project_in_all_indices (project, edkrepo_cfg,= edkrepo_user_cfg, except_ except KeyError: raise EdkrepoInvalidParametersException(except_msg_man_repo) elif os.path.isabs(project): - return None, None, project + manifest =3D ManifestXml(project) + try: + found_manifest_repo, found_cfg, found_project =3D find_project= _in_all_indices(manifest.project_info.codename, + = edkrepo_cfg, + = edkrepo_user_cfg, + = except_msg_man_repo, + = except_msg_not_found, + = man_repo) + return found_manifest_repo, found_cfg, project + except EdkrepoManifestNotFoundException: + return None, None, project elif os.path.isfile(os.path.join(os.getcwd(), project)): - return None, None, os.path.join(os.getcwd(), project) + manifest =3D os.path.join(os.getcwd(), project) + try: + found_manifest_repo, found_cfg, found_project =3D find_project= _in_all_indices(manifest.project_info.codename, + = edkrepo_cfg, + = edkrepo_user_cfg, + = except_msg_man_repo, + = except_msg_not_found, + = man_repo) + return found_manifest_repo, found_cfg, project + except EdkrepoManifestNotFoundException: + return None, None, os.path.join(os.getcwd(), project) elif not os.path.dirname(project): for repo in cfg_man_repos: if (man_repo and (repo =3D=3D man_repo)) or not man_repo: @@ -215,7 +235,7 @@ def find_source_manifest_repo(project_manifest, edkrepo= _cfg, edkrepo_user_cfg, m = edkrepo_user_cfg, = humble.PROJ_NOT_IN_REPO.format(project_manifest.project_info.codename), = humble.SOURCE_MANIFEST_REPO_NOT_FOUND.format(project_manifest.project_in= fo.codename), - = man_repo=3DNone) + = man_repo) project_manifest.write_source_manifest_repo(src_man_repo) return src_man_repo =20 --=20 2.16.2.windows.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 (#58902): https://edk2.groups.io/g/devel/message/58902 Mute This Topic: https://groups.io/mt/74081302/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-