From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.4894.1588309989753910554 for ; Thu, 30 Apr 2020 22:13:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: I3ii7C/q82NKFrdKkMTLYOrNX6JaaFsm56EpK5g4/Y3e8afqavL2LVoQyRNA3/lgiTL3QzKHb0 tjFamv8T0BaQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 22:13:08 -0700 IronPort-SDR: hug5Mq4QWnu9MN6pVr5ybGPFQ7OFyibJc0GiICBwsdu3u0V/qOXprhNoQ2qTYWUu8ckr9XrjsD hJezJkZllABA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,338,1583222400"; d="scan'208";a="283096090" Received: from aedesimo-desk.amr.corp.intel.com ([10.212.210.118]) by fmsmga004.fm.intel.com with ESMTP; 30 Apr 2020 22:12:49 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-stagin/EdkRepo] [PATCH 6/8] EdkRepo: Add ability to determine the source manifest of a workspace Date: Thu, 30 Apr 2020 22:12:37 -0700 Message-Id: <20200501051239.13976-7-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200501051239.13976-1-ashley.e.desimone@intel.com> References: <20200501051239.13976-1-ashley.e.desimone@intel.com> 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_maintenance_humble.py b/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenance_humble.py index e592f19..05e76b1 100644 --- a/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenance_humble.py +++ b/edkrepo/common/workspace_maintenance/humble/manifest_repos_maintenance_humble.py @@ -25,3 +25,5 @@ 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') +SOURCE_MAN_REPO_NOT_FOUND = 'Could not determine the source global manifest repository for project: {}' +PROJ_NOT_IN_REPO = 'Project: {} does not exist in any global manifest repository' \ No newline at end of file diff --git a/edkrepo/common/workspace_maintenance/manifest_repos_maintenance.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(dirpath, project) +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 = find_project_in_all_indices(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.codename), + man_repo=None) + project_manifest.write_source_manifest_repo(src_man_repo) + return src_man_repo -- 2.16.2.windows.1