From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Desimone, Ashley E" <ashley.e.desimone@intel.com>
Cc: "Pandya, Puja" <puja.pandya@intel.com>,
"Bjorge, Erik C" <erik.c.bjorge@intel.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
"Agyeman, Prince" <prince.agyeman@intel.com>
Subject: Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 2/7] EdkRepo: Add downloading all available manifest repositories
Date: Thu, 30 Apr 2020 21:28:20 +0000 [thread overview]
Message-ID: <BL0PR11MB348909AB2CEC73EE6E6A0F08CDAA0@BL0PR11MB3489.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200428215710.45504-3-ashley.e.desimone@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ashley E
> Desimone
> Sent: Tuesday, April 28, 2020 2:57 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
> <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Bret
> Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince
> <prince.agyeman@intel.com>
> Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 2/7] EdkRepo: Add
> downloading all available manifest repositories
>
> 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 <ashley.e.desimone@intel.com>
> Cc: Nate DeSimone <nathaniel.l.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>
> Cc: Prince Agyeman <prince.agyeman@intel.com>
> ---
> .../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_ma
> intenance_humble.py
> b/edkrepo/common/workspace_maintenance/humble/manifest_repos_ma
> intenance_humble.py
> index 440fd8a..e592f19 100644
> ---
> a/edkrepo/common/workspace_maintenance/humble/manifest_repos_ma
> intenance_humble.py
> +++
> b/edkrepo/common/workspace_maintenance/humble/manifest_repos_ma
> inten
> +++ ance_humble.py
> @@ -21,3 +21,7 @@ SINGLE_MAN_REPO_NOT_CFG_BRANCH = ('The
> current active branch, {}, is not the '
> 'specified branch for global manifst repository: {}')
> SINGLE_MAN_REPO_CHECKOUT_CFG_BRANCH = 'Checking out the
> specified branch: {} prior to syncing'
> SINGLE_MAN_REPO_MOVED = '{}{}WARNING:{}{} The global manifest
> repository has moved. Backing up previous global manifest repository to:
> {{}}{}\n'.format(Style.BRIGHT, Fore.RED, Style.RESET_ALL, Fore.RED,
> Style.RESET_ALL)
> +CONFLICT_NO_CLONE = ('The definition of global manifest repository, {}, '
> + 'in the edkrepo_user.cfg does not match the definition in the
> edkrepo.cfg. '
> + 'This global manifest repository will not be downloaded or
> updated. '
> + 'Resolve the conflict and then re-run the failed
> +operation')
> diff --git
> a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc
> e.py
> b/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc
> e.py
> index ad6ddbc..24ad76a 100644
> ---
> a/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc
> e.py
> +++
> b/edkrepo/common/workspace_maintenance/manifest_repos_maintenanc
> e.py
> @@ -57,6 +57,44 @@ def pull_single_manifest_repo(url, branch, local_path,
> reset_hard=False):
> print (humble.CLONE_SINGLE_MAN_REPO.format(local_path, url))
> repo = Repo.clone_from(url, local_path,
> progress=GitProgressHandler(), branch=branch)
>
> +def pull_all_manifest_repos(edkrepo_cfg, edkrepo_user_cfg,
> reset_hard=False):
> + '''
> + Clones or syncs all global manifest repositories defined in both the
> + edkrepo_cfg and the edkrepo_user.cfg)
> + '''
> + cfg_man_repos = []
> + user_cfg_man_repos = []
> + conflicts, duplicates =
> 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(repo),
> + 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(repo)
> ,
> + edkrepo_user_cfg.get_manifest_repo_branch(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
> --
> 2.16.2.windows.1
>
>
>
next prev parent reply other threads:[~2020-04-30 21:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 21:57 [edk2-staging/EdkRepo] [PATCH 0/7] Support for consuming multiple manifest repositories Ashley E Desimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 1/7] EdkRepo: Add check for conflicting/duplicated manifest repo definitions Ashley E Desimone
2020-04-30 21:28 ` [edk2-devel] " Nate DeSimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 2/7] EdkRepo: Add downloading all available manifest repositories Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone [this message]
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 3/7] EdkRepo: Add optional field to edkrepo_manifst to track the source manifest repo Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 4/7] EdkRepo: Add list_available_manifest_repos() Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 5/7] EdkRepo: Add ability to find projects across all manifest repositories Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone
2020-04-30 21:40 ` Bjorge, Erik C
2020-04-30 22:07 ` Nate DeSimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 6/7] EdkRepo: Add ability to determine the source manifest of a workspace Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone
2020-04-28 21:57 ` [edk2-staging/EdkRepo] [PATCH 7/7] EdkRepo: Add the ability to pull only the global manifest repository for a given workspace Ashley E Desimone
2020-04-30 21:28 ` Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BL0PR11MB348909AB2CEC73EE6E6A0F08CDAA0@BL0PR11MB3489.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox