From: "Bjorge, Erik C" <erik.c.bjorge@intel.com>
To: "Desimone, Ashley E" <ashley.e.desimone@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
"Pandya, Puja" <puja.pandya@intel.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
"Agyeman, Prince" <prince.agyeman@intel.com>
Subject: Re: [edk2-staging/EdkRepo] [PATCH v2 6/6] EdkRepo: Add 'get' functions for Manifest Repo data
Date: Fri, 17 Apr 2020 20:27:34 +0000 [thread overview]
Message-ID: <MW3PR11MB4554DA51506C97DFF965027DAED90@MW3PR11MB4554.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200417171829.23032-7-ashley.e.desimone@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone@intel.com>
Sent: Friday, April 17, 2020 10:18 AM
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-staging/EdkRepo] [PATCH v2 6/6] EdkRepo: Add 'get' functions for Manifest Repo data
Added functions to get the URL, LocalPath, Branch and the absolute path for individual manifest repositories to the BaseConfig class.
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>
---
edkrepo/config/config_factory.py | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index 4ae06f6..90f393c 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -127,6 +127,43 @@ class BaseConfig():
"""
return [x for x in self.prop_list if manifest_repo in x.name]
+ def get_manifest_repo_url(self, manifest_repo):
+ """
+ Returns the URL value for a given manifest repo based on config
+ file contents.
+ """
+ for prop in self.manifest_repo_props(manifest_repo):
+ if 'URL' == prop.key:
+ return self.cfg[prop.section][prop.key]
+ return None
+
+ def get_manifest_repo_branch(self, manifest_repo):
+ """
+ Returns the Branch value for a given manifest repo based on config file
+ contents.
+ """
+ for prop in self.manifest_repo_props(manifest_repo):
+ if 'Branch' == prop.key:
+ return self.cfg[prop.section][prop.key]
+ return None
+
+ def get_manifest_repo_local_path(self, manifest_repo):
+ """
+ Returns the Local path value for a given manifest repo based on config
+ file contents.
+ """
+ for prop in self.manifest_repo_props(manifest_repo):
+ if 'LocalPath' == prop.key:
+ return self.cfg[prop.section][prop.key]
+ return None
+
+ def manifest_repo_abs_path(self, manifest_repo):
+ """
+ Returns the absolute path of a single manifest repo based on config
+ file contents and the global_data_dir location.
+ """
+ return os.path.join(self.global_data_dir,
+ self.get_manifest_repo_local_path(manifest_repo))
+
class GlobalConfig(BaseConfig):
"""
Class access structure for the edkrepo.cfg file. This file is read only and maintained by the
--
2.16.2.windows.1
next prev parent reply other threads:[~2020-04-17 20:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 17:18 [edk2-staging/EdkRepo] [PATCH v2 0/6] EdkRepo: Add Initial Config Factory Support for Multiple Manifest Repositories Ashley E Desimone
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 1/6] EdkRepo: Support Updated CFG Format Defining Multiple Manifest Repos Ashley E Desimone
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 2/6] EdkRepo: Add new sections to edkrepo.cfg Ashley E Desimone
2020-04-17 20:27 ` Bjorge, Erik C
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 3/6] EdkRepo: Add the manifest_repo_list property to BaseConfig Ashley E Desimone
2020-04-17 20:26 ` Bjorge, Erik C
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 4/6] EdkRepo: Add manifest_repo_props() Ashley E Desimone
2020-04-17 20:27 ` Bjorge, Erik C
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 5/6] EdkRepo: Move edkrepo_global_data directory to BaseConfig Ashley E Desimone
2020-04-17 20:28 ` Bjorge, Erik C
2020-04-17 17:18 ` [edk2-staging/EdkRepo] [PATCH v2 6/6] EdkRepo: Add 'get' functions for Manifest Repo data Ashley E Desimone
2020-04-17 20:27 ` Bjorge, Erik C [this message]
2020-04-19 2:13 ` [edk2-devel] [edk2-staging/EdkRepo] [PATCH v2 0/6] EdkRepo: Add Initial Config Factory Support for Multiple Manifest Repositories Nate DeSimone
2020-04-19 2:18 ` 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=MW3PR11MB4554DA51506C97DFF965027DAED90@MW3PR11MB4554.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