From nobody Sun May 5 12:13:34 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+58267+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+58267+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111037; cv=none; d=zohomail.com; s=zohoarc; b=PDlppic0ED75Mvxyb1hzrbCppfpJosKNMgwLcoNcWjVlmcsEAv/JyK7IJMo5A96IoPhmdnb/jq7xLXgcx0EEAV6Kl8kJjLknC7kD/VIDBasxNOyhyL1BVTpEPXPPLMMy+An81w131QIrqe6L0Ht62SqxS4myWcSulsnO1AKnnAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111037; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ymwTJmN39gdC1qDCMyAB7dhU5EQPzj5W/nLD2vUp+EQ=; b=JF9xe4bv7zc5+mKKCj0z5sNbSgrJg4NOSiJzBmy313KCE06C6GhlVBkOVQ6Jg5QF8pYXb0FHAQWWfRoAcIUngiSubZXDYyuTovpZgRkIJewDdwVw3hRprKP34kX923Jl3QYJyAmZMNIkHd8EkNYqIBfFa9tQzgHMoXbnvfSPwZA= 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+58267+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 1588111037346182.3782103163261; Tue, 28 Apr 2020 14:57:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VgA0YY1788612xWwILVhxx6J; Tue, 28 Apr 2020 14:57:17 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.407.1588111036004922289 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: PBECau0orIXhDAdUXrZnH8PBHRtVTnDcvq/UMzyL9LinFu3kIb+2LsG7y8jpvNru7GMjRbRGuP 9uSoKiRhxcBw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: RL3lmaIKmV2u0+ZVPWK2WuJgU0K2+RG+KwwwQoFCrH5NW16N01sYzcXTmi8jf67zSRygR+4Ag/ Iih7g0uYFxkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642467" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 1/7] EdkRepo: Add check for conflicting/duplicated manifest repo definitions Date: Tue, 28 Apr 2020 14:57:04 -0700 Message-Id: <20200428215710.45504-2-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: RXHrcBoaF1QnwlaSlOcYdoW8x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111037; bh=YYsz4r1WoQVKh8oQAQv7zHdgnS/zGDaSUd2duFqRCh4=; h=Cc:Date:From:Reply-To:Subject:To; b=AiFgBxK/hOhHfLLL5fmKhIh1ucmLEJgkp0Wg/CGmK+8O/tOx1wrhIwS0PXF5wG1ITn7 oK4Hz8MurGqkdk89cHZoGlH+kYlmebzjWt6mDcG30evXAxm8/A9kfclNj86Pl8xogcvTN vwY3+ALtg3NjBE3Zo5xVIWgiegqHKf8cMdI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a functions to check for conflicting or duplicated manifest repository definitions in the edkrepo.cfg and the edkrepo_user.cfg files. Two manifest repositories definitions are considered conflicting if they have the same name and at least one of URL, branch or local path differ. Two manifest repository definitions are considered duplicates if the name, URL, branch and local path are the same. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../manifest_repos_maintenance.py | 25 ++++++++++++++++++= ++++ 1 file changed, 25 insertions(+) diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index 6e26d4f..ad6ddbc 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -57,3 +57,28 @@ def pull_single_manifest_repo(url, branch, local_path, r= eset_hard=3DFalse): print (humble.CLONE_SINGLE_MAN_REPO.format(local_path, url)) repo =3D Repo.clone_from(url, local_path, progress=3DGitProgre= ssHandler(), branch=3Dbranch) =20 +def detect_man_repo_conflicts_duplicates(edkrepo_cfg, edkrepo_user_cfg): + ''' + Determines whether there is are conflicting or duplicated manifest + repositories listed in the edkrepo.cfg and the edkrepo_user.cfg. + ''' + conflicts =3D [] + duplicates =3D [] + if not edkrepo_user_cfg.manifest_repo_list: + return conflicts, duplicates + else: + config_repos =3D set(edkrepo_cfg.manifest_repo_list) + user_cfg_repos =3D set(edkrepo_user_cfg.manifest_repo_list) + if config_repos.isdisjoint(user_cfg_repos): + return conflicts, duplicates + else: + for repo in config_repos.intersection(user_cfg_repos): + if edkrepo_cfg.get_manifest_repo_url(repo) !=3D edkrepo_user_c= fg.get_manifest_repo_url(repo): + conflicts.append(repo) + elif edkrepo_cfg.get_manifest_repo_branch(repo) !=3D edkrepo_u= ser_cfg.get_manifest_repo_branch(repo): + conflicts.append(repo) + elif edkrepo_cfg.get_manifest_repo_local_path(repo) !=3D edkre= po_user_cfg.get_manifest_repo_local_path(repo): + conflicts.append(repo) + else: + duplicates.append(repo) + return conflicts, duplicates --=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 (#58267): https://edk2.groups.io/g/devel/message/58267 Mute This Topic: https://groups.io/mt/73340188/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- From nobody Sun May 5 12:13:34 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+58268+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+58268+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111037; cv=none; d=zohomail.com; s=zohoarc; b=ebYQ5zdPkj5l6TX4d1FrHhrS8NZ1ZFQRmtydXFBcT6PKxcwdVf8SZJi8Slj5IQaMmdIqCv84gxDR1NkNSTw7jNAUS/khZjjfMj5XGMzJ4FvoLiWEXmt9ByBPIvS9wtDuu5RawnD4Bo5BYn9ttjxIeBwhuESx6kpIvqk5RyFYUL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111037; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=bF+Ais36/6oicZkCDE2zIhGBijFSr06VSSz4PaVQIeg=; b=PMuhXk34Zk+JByktqkWLudUfZ/7j/Ag3zI+QQS7W+zu2cv2QicMnll2bwjqz61gA55MAe/9RkE0d/mUJIQRcF6xcG4aYRIdAdPnDtP9fswSLtxvGdy8cjH0lAwmdvVtmqvV29MYyHJiP1tA2xweUXaZ9KKeAuibOar3yMVQTTPc= 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+58268+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 1588111037770411.84157028351683; Tue, 28 Apr 2020 14:57:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iahMYY1788612xfc0dPnHe43; Tue, 28 Apr 2020 14:57:17 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web11.382.1588111035181534714 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: HQQ+wf16SJmIy7cfuwwu5ZjVyWd+aAMJKFqSsIdWu4U0T5WvfcSj1O0ETg7S8dYDxeYt+RwUL0 +EOhdmj5ShuA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: apF8765xUJxhgOcJRnOCnUBXmQ/VQlmi5SrW51g7WJJbVIGiBBY0Afir9mZ9ahp3bGE6pKwijf COj+sKA5oRzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642466" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 2/7] EdkRepo: Add downloading all available manifest repositories Date: Tue, 28 Apr 2020 14:57:05 -0700 Message-Id: <20200428215710.45504-3-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: QZleRGnMgtWy9e22wqaTOF9yx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111037; bh=+ATg5VF769tyC7mQZgHij4W+FYTvmj4N/2JwrX4u9QE=; h=Cc:Date:From:Reply-To:Subject:To; b=lLyjfeCAVGnLEc3TShRqbU6gEatmsDkaCxCRu/MLwZ5CJj9Fv7v3z5d3KcT4DH09Ftw kJD4ZGkHzBjf0abN7XYk/GsueOukcRlcfwF7WzuYH4qCR0mOs7esWK+PxcPuao/fhxMfR PR7tpt7jnYb7Gaj9W7Yv3KK7ParbP2iPYZo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a function that will download all available manifest repositories defined in either the edkrepo.cfg or the edkrepo_user.cfg 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 --- .../humble/manifest_repos_maintenance_humble.py | 4 +++ .../manifest_repos_maintenance.py | 38 ++++++++++++++++++= ++++ 2 files changed, 42 insertions(+) diff --git a/edkrepo/common/workspace_maintenance/humble/manifest_repos_mai= ntenance_humble.py b/edkrepo/common/workspace_maintenance/humble/manifest_r= epos_maintenance_humble.py index 440fd8a..e592f19 100644 --- a/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenanc= e_humble.py +++ b/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenanc= e_humble.py @@ -21,3 +21,7 @@ SINGLE_MAN_REPO_NOT_CFG_BRANCH =3D ('The current active b= ranch, {}, is not the ' 'specified branch for global manifst rep= ository: {}') SINGLE_MAN_REPO_CHECKOUT_CFG_BRANCH =3D 'Checking out the specified branch= : {} prior to syncing' SINGLE_MAN_REPO_MOVED =3D '{}{}WARNING:{}{} The global manifest repository= has moved. Backing up previous global manifest repository to: {{}}{}\n'.fo= rmat(Style.BRIGHT, Fore.RED, Style.RESET_ALL, Fore.RED, Style.RESET_ALL) +CONFLICT_NO_CLONE =3D ('The definition of global manifest repository, {}, ' + 'in the edkrepo_user.cfg does not match the definitio= n in the edkrepo.cfg. ' + 'This global manifest repository will not be download= ed or updated. ' + 'Resolve the conflict and then re-run the failed oper= ation') diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index ad6ddbc..24ad76a 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -57,6 +57,44 @@ def pull_single_manifest_repo(url, branch, local_path, r= eset_hard=3DFalse): print (humble.CLONE_SINGLE_MAN_REPO.format(local_path, url)) repo =3D Repo.clone_from(url, local_path, progress=3DGitProgre= ssHandler(), branch=3Dbranch) =20 +def pull_all_manifest_repos(edkrepo_cfg, edkrepo_user_cfg, reset_hard=3DFa= lse): + ''' + Clones or syncs all global manifest repositories defined in both the + edkrepo_cfg and the edkrepo_user.cfg) + ''' + cfg_man_repos =3D [] + user_cfg_man_repos =3D [] + conflicts, duplicates =3D detect_man_repo_conflicts_duplicates(edkrepo= _cfg, edkrepo_user_cfg) + if not conflicts and not duplicates: + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + elif conflicts: + for conflict in conflicts: + # In the case of a conflict do not pull conflicting repo + print(humble.CONFLICT_NO_CLONE.format(conflict)) + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + cfg_man_repos.remove(conflict) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + user_cfg_man_repos.remove(conflict) + elif duplicates: + for duplicate in duplicates: + # the duplicate needs to be ignored in on of the repo lists so= it is + # not cloned/pulled twice + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + user_cfg_man_repos.remove(conflict) + for repo in cfg_man_repos: + pull_single_manifest_repo(edkrepo_cfg.get_manifest_repo_url(repo), + edkrepo_cfg.get_manifest_repo_branch(rep= o), + edkrepo_cfg.get_manifest_repo_local_path= (repo), + reset_hard) + for repo in user_cfg_man_repos: + pull_single_manifest_repo(edkrepo_user_cfg.get_manifest_repo_url(r= epo), + edkrepo_user_cfg.get_manifest_repo_branc= h(repo), + edkrepo_user_cfg.get_manifest_repo_local= _path(repo), + reset_hard) + + def detect_man_repo_conflicts_duplicates(edkrepo_cfg, edkrepo_user_cfg): ''' Determines whether there is are conflicting or duplicated manifest --=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 (#58268): https://edk2.groups.io/g/devel/message/58268 Mute This Topic: https://groups.io/mt/73340189/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- From nobody Sun May 5 12:13:34 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+58265+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+58265+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111036; cv=none; d=zohomail.com; s=zohoarc; b=MNPz32t6wwsLN+lhCy4ZCMxodQlavP2bfH5uEFgh/iqT5ZNNGgrXkybFO+qJSv73+Gk+3UtX0WsidkwovjBmrtkydtFlM+bR87BSQXwMvwc9nOZ7TSOnercXuOLNSOKVBxvQmX8XPhBQV6571sG0S3pSKuTZ6e4GhAc2X9VZA3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111036; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=FtPrU61tEYwhJghiO9AUiALqqoKsTrlxMPaa0H56f7U=; b=QSej9wyyz6aQcFDzQcJAHdxkkbs/xKakUN9ROMCFJ4tDTNMlzjjJSTQdP2uw7ZJx6qnAzlplcxllh47CR35jDp9V7Ie3ckZjHbUdl7sVEw+8u5Df3carz+iuV7B6T53uuBqrkMMLK0lytvg0vRDYoubIFvbN/s5N4qRB146ChmI= 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+58265+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 1588111036509621.2704098137477; Tue, 28 Apr 2020 14:57:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cw9dYY1788612xGne0TiBPSR; Tue, 28 Apr 2020 14:57:16 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.382.1588111035181534714 for ; Tue, 28 Apr 2020 14:57:15 -0700 IronPort-SDR: qKL4EljJnXAXCTIiYMOYRdrM1WqA8odIFQqSWGEnaZlnK1XUcQlTA8AHmIoE/4PhrZINSzEoL0 XAnEe4slZBNA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: ZaaZy/3akIuN3QmIwBQsokpaMpMPVQ7vpn8o+gXZkf863AOjvJj7hfZTmSinMJCBxsIFs6GG8b zQXyQN+2sBuw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642470" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 3/7] EdkRepo: Add optional field to edkrepo_manifst to track the source manifest repo Date: Tue, 28 Apr 2020 14:57:06 -0700 Message-Id: <20200428215710.45504-4-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: ToiuVrYMc2A9m0ZJOm6r4d7Nx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111036; bh=8g14S1ZPlQEDqJE81V7zD+iPPiwpuqFF4FLzngyBnAY=; h=Cc:Date:From:Reply-To:Subject:To; b=WI181LaJLA3FyfufIESbWFaF649mVYynDw3/qwjMioPJ3p2zCDdjxFD6FLUSi8q+s9u VL0Iz8Jn3vHOy6c4PrRD4ghmhUc63veWnfZrSUer9EgQcBDJPaiqGkglfbjy1beW5Mohx 1XpRcv08kI9SBbwfuWrx3QpFHpjA3Sb0whw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add the SourceManifestRepository to the edkrepo manfiest general config for use by edkrepo to track the source manifest repository for the workspac= e. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- edkrepo_manifest_parser/edk_manifest.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_par= ser/edk_manifest.py index 080448f..dcf9c29 100644 --- a/edkrepo_manifest_parser/edk_manifest.py +++ b/edkrepo_manifest_parser/edk_manifest.py @@ -21,7 +21,7 @@ import copy # All the namedtuple data structures that consumers of this module will ne= ed. # ProjectInfo =3D namedtuple('ProjectInfo', ['codename', 'description', 'dev= _leads', 'reviewers', 'org', 'short_name']) -GeneralConfig =3D namedtuple('GeneralConfig', ['default_combo', 'current_c= ombo', 'pin_path']) +GeneralConfig =3D namedtuple('GeneralConfig', ['default_combo', 'current_c= ombo', 'pin_path', 'source_man_repo']) RemoteRepo =3D namedtuple('RemoteRepo', ['name', 'url']) RepoHook =3D namedtuple('RepoHook', ['source', 'dest_path', 'dest_file', '= remote_url']) Combination =3D namedtuple('Combination', ['name', 'description']) @@ -406,6 +406,24 @@ class ManifestXml(BaseXmlHelper): self._tree.write(filename) self.__general_config.current_combo =3D combo_name =20 + def write_source_manifest_repo(self, manifest_repo, filename=3DNone): + ''' + Writes the name of the source manifest repository to the + general config sections of the manifest file. + ''' + if filename is None: + filename =3D self._fileref + subroot =3D self._tree.find('GeneralConfig') + if subroot is None: + raise KeyError(GENERAL_CONFIG_MISSING_ERROR) + + element =3D subroot.find('SourceManifestRepository') + if element is None: + element =3D ET.SubElement(subroot, 'SourceManifestRepository') + element.attrib['manifest_repo'] =3D manifest_repo + self._tree.write(filename) + self.__general_config.source_man_repo =3D manifest_repo + def generate_pin_xml(self, description, combo_name, repo_source_list, = filename=3DNone): =20 pin_tree =3D ET.ElementTree(ET.Element('Pin')) @@ -605,10 +623,14 @@ class _GeneralConfig(): self.curr_combo =3D element.find('CurrentClonedCombo').attrib[= 'combination'] except: self.curr_combo =3D None + try: + self.source_man_repo =3D element.find('SourceManifestRepositor= y').attrib['manifest_repo'] + except: + self.source_man_repo =3D None =20 @property def tuple(self): - return GeneralConfig(self.default_combo, self.curr_combo, self.pin= _path) + return GeneralConfig(self.default_combo, self.curr_combo, self.pin= _path, self.source_man_repo) =20 class _RemoteRepo(): def __init__(self, element): --=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 (#58265): https://edk2.groups.io/g/devel/message/58265 Mute This Topic: https://groups.io/mt/73340184/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- From nobody Sun May 5 12:13:34 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+58270+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+58270+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111038; cv=none; d=zohomail.com; s=zohoarc; b=PfdRdhTzrVpiaEBrrIGBMHdJpPimSI8ir2n/izlfU2dp0Aozijh82tuI8BYO80HGBPFvXZRpzd0A/zLSTibnT0Itqso9A7itJZSTxyn5OLEX+AMpiP4I2jh+KEHRWsRG196C6GdDewZ2d+hVDLxAW7cIvyC/MkGIMJCiBCfvjkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111038; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=Lxa34A5tKqISd06G1xscYGMl3OnZoPniaL7lvdK3UBg=; b=hMgQCgkRrUhQ+tb4ABra7UWsSHT1DPrg7iIR0GTpjFH9Kt/OPdQoWYHTMiI+aBCwB8UudZXv1POF3l9JUkRW8vXYhMDkiowTbqRQgd0Q/7m9qEomt0IChkgw5vTY6BgYOnmNd+kpoqq4s1o3qrRSfWzHBgF58/s8y2+ubnq7vms= 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+58270+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 1588111038153370.46071060110603; Tue, 28 Apr 2020 14:57:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cNDMYY1788612xJTJ6KscGKW; Tue, 28 Apr 2020 14:57:17 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.407.1588111036004922289 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: Yn5RDHniUJmo1n2XL4IWb7AHb/VfQ95nndqrNJGQUnUwxbVgNpReq3Gknu9tDz10dcT3VVuJ14 NSgEPtO/zAlw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: eBDw0BvN7hJiEYLkR6mk/Tm7WmD31bg+hfwud8C0OTr7GjpjNOgJprNSlhqV3C6KHg3NQiStRh Ms0vdtljdzlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642473" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 4/7] EdkRepo: Add list_available_manifest_repos() Date: Tue, 28 Apr 2020 14:57:07 -0700 Message-Id: <20200428215710.45504-5-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: KmalHvBsIWkSlwS4QITAhBuBx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111037; bh=CGWDJtKEF2sJNs6Ex3/UoGdoT7gEO4lrfiH+OnB1CHs=; h=Cc:Date:From:Reply-To:Subject:To; b=uCzp1yRm5pd2pmo2OepWB/97tj4gEU14kSvkFyqNvxiXXsPsZz7XIoo1YdPxj9rVkEJ nsvpa64uWvyVrJ6JUMrLXl1IJFQa64lLqWho8+VzviFq8g6njgui9DtKG/4BYj3+Gxf2j iEi++h/SO/Z3egXQB17t3K25h+6S+64XNVA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add the ability to calculate a list of available manifest repositories from the contents of the edkrepo.cfg and the edkrepo_user.cfg files. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../manifest_repos_maintenance.py | 53 ++++++++++++++----= ---- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index 24ad76a..4bded46 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -64,25 +64,10 @@ def pull_all_manifest_repos(edkrepo_cfg, edkrepo_user_c= fg, reset_hard=3DFalse): ''' cfg_man_repos =3D [] user_cfg_man_repos =3D [] - conflicts, duplicates =3D detect_man_repo_conflicts_duplicates(edkrepo= _cfg, edkrepo_user_cfg) - if not conflicts and not duplicates: - cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) - user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) - elif conflicts: - for conflict in conflicts: - # In the case of a conflict do not pull conflicting repo - print(humble.CONFLICT_NO_CLONE.format(conflict)) - cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) - cfg_man_repos.remove(conflict) - user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) - user_cfg_man_repos.remove(conflict) - elif duplicates: - for duplicate in duplicates: - # the duplicate needs to be ignored in on of the repo lists so= it is - # not cloned/pulled twice - cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) - user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) - user_cfg_man_repos.remove(conflict) + conflicts =3D [] + cfg_man_repos, user_cfg_man_repos, conflicts =3D list_available_man_re= pos(edkrepo_cfg, edkrepo_user_cfg) + for conflict in conflicts: + print(humble.CONFLICT_NO_CLONE.format(conflict)) for repo in cfg_man_repos: pull_single_manifest_repo(edkrepo_cfg.get_manifest_repo_url(repo), edkrepo_cfg.get_manifest_repo_branch(rep= o), @@ -120,3 +105,33 @@ def detect_man_repo_conflicts_duplicates(edkrepo_cfg, = edkrepo_user_cfg): else: duplicates.append(repo) return conflicts, duplicates + +def list_available_man_repos(edkrepo_cfg, edkrepo_user_cfg): + ''' + Checks for conflicts/duplicates within all manifest repositories defin= ed in + both the edkrepo.cfg and the edkrepo_user.cfg and resturns a list of a= vailable + manifest_repos for each and a list of conflicting manifest repository = entries. + ''' + cfg_man_repos =3D [] + user_cfg_man_repos =3D [] + conflicts, duplicates =3D detect_man_repo_conflicts_duplicates(edkrepo= _cfg, edkrepo_user_cfg) + if not conflicts and not duplicates: + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + elif conflicts: + for conflict in conflicts: + # In the case of a conflict do not pull conflicting repo + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + cfg_man_repos.remove(conflict) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + user_cfg_man_repos.remove(conflict) + elif duplicates: + for duplicate in duplicates: + # the duplicate needs to be ignored in on of the repo lists so= it is + # not cloned/pulled twice + cfg_man_repos.extend(edkrepo_cfg.manifest_repo_list) + user_cfg_man_repos.extend(edkrepo_user_cfg.manifest_repo_list) + user_cfg_man_repos.remove(duplicate) + return cfg_man_repos, user_cfg_man_repos, conflicts + + --=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 (#58270): https://edk2.groups.io/g/devel/message/58270 Mute This Topic: https://groups.io/mt/73340191/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- From nobody Sun May 5 12:13:34 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+58271+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+58271+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111038; cv=none; d=zohomail.com; s=zohoarc; b=PLVzm+1k54WOSCDuSaLvw5vw9djC52vx32ZAMfi/u5tzfd6Khb9LnLnyrL0jO0EX6dZlQydMVR1UPt42Swcb3UKessMNGqVtisk1R4qcj8bcT/iuArku8d57cRK66cb5T6c9vnLtKFXOO1wuM54bt+OuFM/5aVPR8BAq5Ncr+VI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111038; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=7vEst71ZxyPNNPkl/Nuh+HuH9uH+tGR6xNUStjkRIb0=; b=Q8n+qZPdaZL1gg8JzW/saLvh95zwZyOi6rz3pZYZ6u4LAI3itXWtd31ekVdzjNWjexJlQFOlpmtlwano8Qt0S2J43lVLBFCI6hPgeuQErMVH0u3gb0t6cbDvcHS3FADtTUIKnRyC8gMDIahLyjZQl4zXKCZ4hZnQYpbDuAzVaZU= 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+58271+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 1588111038932216.31413441929828; Tue, 28 Apr 2020 14:57:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gGIKYY1788612xfpB7UbmbRR; Tue, 28 Apr 2020 14:57:18 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web11.382.1588111035181534714 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: pWlS90LVK1SXUbVLE2G9qFZLTQ5jcCQTTPVDxUfHdF41e9qdLdupX8WwrV1p1qGMcJ2/mCM5cy xMAVTseHulOw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: 4BbutiazYEsBghLsTwOLipjS0nrXt1CRbeFlzkUjyvYYl6msJizARFUt5fMputd3riqIrH0Hes Sg7J164dnLUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642476" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 5/7] EdkRepo: Add ability to find projects across all manifest repositories Date: Tue, 28 Apr 2020 14:57:08 -0700 Message-Id: <20200428215710.45504-6-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: JO3mZHpY75nGUZLseU3fDMhmx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111038; bh=vKuZUjBP/aMYqP2rK1BU7pVXRdPm4hcG0XuycYqcE7c=; h=Cc:Date:From:Reply-To:Subject:To; b=Ntf7GXpdqVv+JATNZTSNh/fgcG+T6JTKbdcyqhaGukj2ewux6uTBnxYHnPA99stD1NI lLSnoWpc+xlgr5hcZQtv877br5rS78jE18amT77PHLVjyrbL1ogZdgvg0TxrOeFNcFSWL ROVkSz3kavMOOP45eXXuvM5Ia7m17H7/GKM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add find_project_in_all_indicies() to search for and return a tuple (source repo, source config, path to manifest) if a matching project is found. Add find_project_in_single_index() to find the path to a project within a single manifest repositories index file and return a whether the specified project was found and if so its path within the manifest repository. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../manifest_repos_maintenance.py | 70 ++++++++++++++++++= +++- .../workspace_maintenance/workspace_maintenance.py | 17 +++++- 2 files changed, 84 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 4bded46..9b441ac 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -15,11 +15,12 @@ import git from git import Repo =20 import edkrepo.config.config_factory as cfg -from edkrepo.common.edkrepo_exception import EdkrepoUncommitedChangesExcep= tion +from edkrepo.common.edkrepo_exception import EdkrepoUncommitedChangesExcep= tion, EdkrepoInvalidParametersException from edkrepo.common.progress_handler import GitProgressHandler import edkrepo.common.workspace_maintenance.humble.manifest_repos_maintena= nce_humble as humble from edkrepo.common.workspace_maintenance.workspace_maintenance import gen= erate_name_for_obsolete_backup - +from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match +from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml =20 def pull_single_manifest_repo(url, branch, local_path, reset_hard=3DFalse): ''' @@ -135,3 +136,68 @@ def list_available_man_repos(edkrepo_cfg, edkrepo_user= _cfg): return cfg_man_repos, user_cfg_man_repos, conflicts =20 =20 +def find_project_in_single_index (project, index_file, manifest_dir): + ''' + Finds a project in a single global manifest repositories index file. I= f found + returns (True, path to file) if not returns (False, None) + ''' + global_manifest_path =3D None + try: + proj_name =3D case_insensitive_single_match(project, index_file.pr= oject_list) + except: + proj_name =3D None + if proj_name: + ci_index_xml_rel_path =3D os.path.normpath(index_file.get_project_= xml(proj_name)) + global_manifest_path =3D os.path.join(manifest_dir, ci_index_xml_r= el_path) + return True, global_manifest_path + else: + return False, global_manifest_path + + +def find_project_in_all_indices (project, edkrepo_cfg, edkrepo_user_cfg, e= xcept_msg_man_repo, except_msg_not_found, man_repo=3DNone): + ''' + Finds the project in all manifest repositories listed in the edkrepo.e= fg and + edkrepo_user.cfg. If a project with the same name is found uses man_re= po to select + the correct entry + ''' + cfg_man_repos, user_cfg_man_repos, conflicts =3D list_available_man_re= pos(edkrepo_cfg, edkrepo_user_cfg) + projects =3D {} + for repo in cfg_man_repos: + manifest_dir =3D edkrepo_cfg.manifest_repo_abs_path(repo) + index_file =3D CiIndexXml(os.path.join(manifest_dir, 'CiIndex.xml'= )) + found, man_path =3D find_project_in_single_index(project, index_fi= le, manifest_dir) + if found: + projects[repo] =3D ('edkrepo_cfg', man_path) + for repo in user_cfg_man_repos: + manifest_dir =3D edkrepo_user_cfg.manifest_repo_abs_path(repo) + index_file =3D CiIndexXml(os.path.join(manifest_dir, 'CiIndex.xml'= )) + found, man_path =3D find_project_in_single_index(project, index_fi= le, manifest_dir) + if found: + projects[repo] =3D ('edkrepo_user_cfg', man_path) + if len(projects.keys()) =3D=3D 1: + repo =3D list(projects.keys())[0] + return repo, projects[repo][0], projects[repo][1] + elif len(projects.keys()) > 1 and man_repo: + try: + return man_repo, projects[man_repo][0], projects[man_repo][1] + except KeyError: + raise EdkrepoInvalidParametersException(except_msg_man_repo) + elif os.path.isabs(project): + return None, None, project + elif os.path.isfile(os.path.join(os.getcwd(), project)): + 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: + for dirpath, dirname, filenames in os.walk(edkrepo_cfg.man= ifest_repo_abs_path(repo)): + if project in filenames: + return repo, 'edkrepo_cfg', os.path.join(dirpath, = project) + for repo in user_cfg_man_repos: + if (man_repo and (repo =3D=3D man_repo)) or not man_repo: + for dirpath, dirname, filenames in os.walk(edkrepo_user_cf= g.manifest_repo_abs_path(repo)): + if project in filenames: + return repo, 'edkrepo_user_cfg', os.path.join(dirp= ath, project) + + + + diff --git a/edkrepo/common/workspace_maintenance/workspace_maintenance.py = b/edkrepo/common/workspace_maintenance/workspace_maintenance.py index 6e20d43..ba62f6d 100644 --- a/edkrepo/common/workspace_maintenance/workspace_maintenance.py +++ b/edkrepo/common/workspace_maintenance/workspace_maintenance.py @@ -10,6 +10,10 @@ ''' Contains shared workspace maintenance functions. ''' =20 import os +import unicodedata + +from edkrepo.common.edkrepo_exception import EdkrepoFoundMultipleException= , EdkrepoNotFoundException +from edkrepo.common.humble import GEN_A_NOT_IN_B, GEN_FOUND_MULT_A_IN_B =20 def generate_name_for_obsolete_backup(absolute_path): if not os.path.exists(absolute_path): @@ -27,4 +31,15 @@ def generate_name_for_obsolete_backup(absolute_path): if not os.path.exists(os.path.join(dir_name, unique_name)): unique_name_found =3D True index +=3D 1 - return unique_name \ No newline at end of file + return unique_name + +def case_insensitive_equal(str1, str2): + return unicodedata.normalize("NFKD", str1.casefold()) =3D=3D unicodeda= ta.normalize("NFKD", str2.casefold()) + +def case_insensitive_single_match(str1, str_list): + matches =3D [x for x in str_list if case_insensitive_equal(str1, x)] + if len(matches) =3D=3D 0: + raise EdkrepoNotFoundException(GEN_A_NOT_IN_B.format(str1, str_lis= t)) + elif len(matches) > 1: + raise EdkrepoFoundMultipleException(GEN_FOUND_MULT_A_IN_B.format(s= tr1, str_list)) + return matches[0] --=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 (#58271): https://edk2.groups.io/g/devel/message/58271 Mute This Topic: https://groups.io/mt/73340193/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- From nobody Sun May 5 12:13:34 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+58269+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+58269+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111038; cv=none; d=zohomail.com; s=zohoarc; b=SgaDrGn3mRFl4drmgSo86oBhT/63QbOOB+wj8RZLdcQUqxHa/LTZ580/ZJOLZoMGdaePrCoFfrftAuuQU3sZCOC/ZtU5NCo+zfmK/OIj7Z86sMuqn/UKwZyvsTcykEYEGcnRPZzCbxAfoY7eKm/6klgSRkDVrizumwvCkIlQq9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111038; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=T/tgQ+Ii46X0JZMOL+zdFfLg+ti03XkMlRywrw8IB/s=; b=OatJKkLGo7GsL4GCkhIEIuZ1Jqb+zmMcVqKdvnT98fid9lJOTnd3Nr0aQEU/KTmht4kIPJvktZ/bmY6g+CwVJYTbenajnrRlXU5XmdlJySMEQp/V3WPAXUToNk/uWtp2NjI2DOFxncDZY4DasWrgI0q7GqCAz0WQKARwAsX5nHY= 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+58269+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 1588111038548352.05940021264416; Tue, 28 Apr 2020 14:57:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id GgN4YY1788612xL2ANhBre4N; Tue, 28 Apr 2020 14:57:18 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web11.382.1588111035181534714 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: fW7zfJs6sFJkkS25dwehZa4+4nX5wDRKZqlXUVONQoEmF2DwJ3MGwCdnO140GsZkOlVM7Qo5Ho I+k3q9RieeNw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: zt1K2uZsLa/0wsaolXRD2ae78nQlAryAsnW8m/kNmIi42qXEk40YBG//ruBwepwTsEsmDZ3w3X ot2u6+fnafBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642479" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 6/7] EdkRepo: Add ability to determine the source manifest of a workspace Date: Tue, 28 Apr 2020 14:57:09 -0700 Message-Id: <20200428215710.45504-7-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: NP5R7qtxqXq2EzSEZXGZODHQx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111038; bh=XOV/4nGi2nIfZPZeotQzDx0K+M82W2xBoMNTud23a+0=; h=Cc:Date:From:Reply-To:Subject:To; b=jXIor1dHztxaa2aU35NuxwGplZV/GX1XWF84Axt9J+EEkrkA4696Rjme1aQEUugN/UJ ZD4czao4ks4MtrReR8we7T4oZYdcOEGOqdf6+rcTXmniha4VvGMF3XXx0XIs93ACPgD/N t5J6fhOTdQS0BWSZ/csIDIn9+K1X0ytcdaw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add find_source_man_repo() to check if for the source manifest repo is contained in the workspaces project manifest file. If it is not determine the value and write it to the manifest. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../humble/manifest_repos_maintenance_humble.py | 2 ++ .../workspace_maintenance/manifest_repos_maintenance.py | 15 +++++++++++= ++++ 2 files changed, 17 insertions(+) diff --git a/edkrepo/common/workspace_maintenance/humble/manifest_repos_mai= ntenance_humble.py b/edkrepo/common/workspace_maintenance/humble/manifest_r= epos_maintenance_humble.py index e592f19..05e76b1 100644 --- a/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenanc= e_humble.py +++ b/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenanc= e_humble.py @@ -25,3 +25,5 @@ CONFLICT_NO_CLONE =3D ('The definition of global manifest= repository, {}, ' 'in the edkrepo_user.cfg does not match the definitio= n in the edkrepo.cfg. ' 'This global manifest repository will not be download= ed or updated. ' 'Resolve the conflict and then re-run the failed oper= ation') +SOURCE_MAN_REPO_NOT_FOUND =3D 'Could not determine the source global manif= est repository for project: {}' +PROJ_NOT_IN_REPO =3D 'Project: {} does not exist in any global manifest re= pository' \ No newline at end of file diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index 9b441ac..7b3f866 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -199,5 +199,20 @@ def find_project_in_all_indices (project, edkrepo_cfg,= edkrepo_user_cfg, except_ return repo, 'edkrepo_user_cfg', os.path.join(dirp= ath, project) =20 =20 +def find_source_man_repo (project_manifest, edkrepo_cfg, edkrepo_user_cfg): + ''' + Finds the source manifest repo for a given project. + ''' + if project_manifest.general_config.source_man_repo: + return project_manifest.general_config.source_man_repo + else: + src_man_repo, src_config, src_man_path =3D find_project_in_all_ind= ices(project_manifest.project_info.codename, + = edkrepo_cfg, + = edkrepo_user_cfg, + = humble.PROJ_NOT_IN_REPO.format(project_manifest.project_info.codename), + = humble.SOURCE_MAN_REPO_NOT_FOUND.format(project_manifest.project_info.co= dename), + = man_repo=3DNone) + project_manifest.write_source_manifest_repo(src_man_repo) + return src_man_repo =20 =20 =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 (#58269): https://edk2.groups.io/g/devel/message/58269 Mute This Topic: https://groups.io/mt/73340190/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- From nobody Sun May 5 12:13:34 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+58272+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+58272+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588111039; cv=none; d=zohomail.com; s=zohoarc; b=XWQ591eP2ESVZz7n0iH37EIIr9CFWs9tVIbvBMhpFacV3KaE4eteDGrS+2X5yLTQ0mO7caLhdd/HB1WFTz4YzXLYgJ5HRv3cq3fXQe1BI46a5QMR4j3vVw8UmF4OEiC0hKYIKKonYaUydJ5hSgAQd+yzpjFTMXZ1xT8agwZFtgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588111039; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ajtDC9St4bh+xBxaZ2yjq3xe+k3tMQgbFvbSwvI5zVA=; b=VF574cC8i+9ew9vUzZ025+wBxrUeW3tz77sCcF+1ewBRMiX3wDAebDMe8FshVt9wQPZMXJGHJm9FyyUppQkMy1jDjYY7tvvWFA0CyZyGIlIKbjzmGFuShegsO6JM0S+S3X6sMfwcyT7HxtOL/kyOzEXdsqTkhf+aaWYkW9ZL6Z8= 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+58272+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 1588111039403577.0286800079101; Tue, 28 Apr 2020 14:57:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id C9fbYY1788612xkRVGMwXfCu; Tue, 28 Apr 2020 14:57:19 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.407.1588111036004922289 for ; Tue, 28 Apr 2020 14:57:16 -0700 IronPort-SDR: l2UlS7Co4y9ssbWkYWuOmNyi7BV0/d+nsPQ2ieoWhCQC5OCZcvoxC+UdxlRxg5bIdpJHwXtsb3 nD1Ljb7/cmcg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 14:57:13 -0700 IronPort-SDR: IyDXp0aUiRh95cv8PbRiQ6f8XOkO9GoSpC8UOCr5uBC1auUJ9cICkM7u/Lc/zWB8asNhY9NjSV Vy526ungIOJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="246642481" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 28 Apr 2020 14:57:13 -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 7/7] EdkRepo: Add the ability to pull only the global manifest repository for a given workspace. Date: Tue, 28 Apr 2020 14:57:10 -0700 Message-Id: <20200428215710.45504-8-ashley.e.desimone@intel.com> In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: <27952.devel.edk2.groups.io> 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: 7hGNHH9ip76L1VtmlzsPNQscx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588111039; bh=xkGj+J7Y3VLhj1sDjNvTkx/7+tVVtWOe9DK+Yh4Eaao=; h=Cc:Date:From:Reply-To:Subject:To; b=Cl4rs5jS9SAq/52m/1aNLXvgy34uz63IyzSKJkrzFx2wrjhBGMGcSJr5vXFaDRRCdSH Tk/Rv+eSeiPRrVDQmWkQY60z5QHdHN3BZz21JU68xYQ62apI6/a2958LqXi+Jqe2ghRoH /chCOFIgkWn2z8m1hTmpwaun5Xu5c5rgGKo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add pull_workspace_man_repo() to pull only the global manifest repository affiliated with a single workspace. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../manifest_repos_maintenance.py | 23 ++++++++++++++++++= ++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc= e.py b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py index 7b3f866..7a7f946 100644 --- a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py +++ b/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.py @@ -199,7 +199,7 @@ def find_project_in_all_indices (project, edkrepo_cfg, = edkrepo_user_cfg, except_ return repo, 'edkrepo_user_cfg', os.path.join(dirp= ath, project) =20 =20 -def find_source_man_repo (project_manifest, edkrepo_cfg, edkrepo_user_cfg): +def find_source_man_repo(project_manifest, edkrepo_cfg, edkrepo_user_cfg, = man_repo=3DNone): ''' Finds the source manifest repo for a given project. ''' @@ -213,6 +213,25 @@ def find_source_man_repo (project_manifest, edkrepo_cf= g, edkrepo_user_cfg): = humble.SOURCE_MAN_REPO_NOT_FOUND.format(project_manifest.project_info.co= dename), = man_repo=3DNone) project_manifest.write_source_manifest_repo(src_man_repo) - return src_man_repo =20 + return src_man_repo + +def pull_workspace_man_repo(project_manifest, edkrepo_cfg, edkrepo_user_cf= g, man_repo=3DNone, reset_hard=3DFalse): + ''' + Pulls only the global manifest repo for the current workspace. + ''' + src_man_repo =3D find_source_man_repo(project_manifest, edkrepo_cfg, e= dkrepo_user_cfg, man_repo) + config_repos, user_config_repos, conflicts =3D list_available_man_repo= s(edkrepo_cfg, edkrepo_user_cfg) + if src_man_repo in config_repos: + pull_single_manifest_repo(edkrepo_cfg.get_manifest_repo_url(src_ma= n_repo), + edkrepo_cfg.get_manifest_repo_branch(src= _man_repo), + edkrepo_cfg.get_manifest_repo_local_path= (src_man_repo), + reset_hard) + elif src_man_repo in user_config_repos: + pull_single_manifest_repo(edkrepo_user_cfg.get_manifest_repo_url(s= rc_man_repo), + edkrepo_user_cfg.get_manifest_repo_branc= h(src_man_repo), + edkrepo_user_cfg.get_manifest_repo_local= _path(src_man_repo), + reset_hard) + elif src_man_repo in conflicts: + raise EdkrepoInvalidParametersException(humble.CONFLICT_NO_CLONE.f= ormat(src_man_repo)) =20 =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 (#58272): https://edk2.groups.io/g/devel/message/58272 Mute This Topic: https://groups.io/mt/73340194/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-