From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: qKL4EljJnXAXCTIiYMOYRdrM1WqA8odIFQqSWGEnaZlnK1XUcQlTA8AHmIoE/4PhrZINSzEoL0 XAnEe4slZBNA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False 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" 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-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> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200428215710.45504-1-ashley.e.desimone@intel.com> References: <20200428215710.45504-1-ashley.e.desimone@intel.com> Add the SourceManifestRepository to the edkrepo manfiest general config for use by edkrepo to track the source manifest repository for the workspace. 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_parser/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 need. # ProjectInfo = namedtuple('ProjectInfo', ['codename', 'description', 'dev_leads', 'reviewers', 'org', 'short_name']) -GeneralConfig = namedtuple('GeneralConfig', ['default_combo', 'current_combo', 'pin_path']) +GeneralConfig = namedtuple('GeneralConfig', ['default_combo', 'current_combo', 'pin_path', 'source_man_repo']) RemoteRepo = namedtuple('RemoteRepo', ['name', 'url']) RepoHook = namedtuple('RepoHook', ['source', 'dest_path', 'dest_file', 'remote_url']) Combination = namedtuple('Combination', ['name', 'description']) @@ -406,6 +406,24 @@ class ManifestXml(BaseXmlHelper): self._tree.write(filename) self.__general_config.current_combo = combo_name + def write_source_manifest_repo(self, manifest_repo, filename=None): + ''' + Writes the name of the source manifest repository to the + general config sections of the manifest file. + ''' + if filename is None: + filename = self._fileref + subroot = self._tree.find('GeneralConfig') + if subroot is None: + raise KeyError(GENERAL_CONFIG_MISSING_ERROR) + + element = subroot.find('SourceManifestRepository') + if element is None: + element = ET.SubElement(subroot, 'SourceManifestRepository') + element.attrib['manifest_repo'] = manifest_repo + self._tree.write(filename) + self.__general_config.source_man_repo = manifest_repo + def generate_pin_xml(self, description, combo_name, repo_source_list, filename=None): pin_tree = ET.ElementTree(ET.Element('Pin')) @@ -605,10 +623,14 @@ class _GeneralConfig(): self.curr_combo = element.find('CurrentClonedCombo').attrib['combination'] except: self.curr_combo = None + try: + self.source_man_repo = element.find('SourceManifestRepository').attrib['manifest_repo'] + except: + self.source_man_repo = None @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) class _RemoteRepo(): def __init__(self, element): -- 2.16.2.windows.1