From nobody Tue Apr 30 17:54:06 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+58526+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+58526+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588365594; cv=none; d=zohomail.com; s=zohoarc; b=Fr59RLzCwOyGGHjKx+q+FE4KIDlKxRYvXStTaHpEiPQEgfkQBc8NeCadXFBiolhFzInAkcT1r+7dC3oR+Jw3SE478tql5kJ5noVcr1FCqiFbA4GICdT7kJH9HrSmPSjlM0K4iDNN7JuQdZzEG/RIQN3iei/BtwSzSM00V/wuj78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588365594; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=gWKtrNPta2cM5vFM+obJ5SnvTHiGFD43jNoT5nzD894=; b=d1wFndweD0iacL3+3AXwbwfcmT/WKWTeBAGZiltlCgN35xVU0RxWQwfS4dC6CEFI0zA3IY3vK+FNKXYZpf04o98+Hx0BMBAoaWq4JHiXXUqdD/5g+9VItGWnXytnCeTCWr9ldBO0kb1SbRcWFPFtOacN80noCiA2L6uDE98YI4c= 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+58526+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 1588365594131574.2395743296147; Fri, 1 May 2020 13:39:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kAvsYY1788612xvEgCberRQE; Fri, 01 May 2020 13:39:53 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.3649.1588365590739524866 for ; Fri, 01 May 2020 13:39:51 -0700 IronPort-SDR: 5PD2SQyfBIqUf3q/I9Q/tQxCKeSaHIu2rVO93dE9QTURNMuOc9KsxsdcIu4CPdtYv02LXLO9Dq HSg2dtBpoVSg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2020 13:39:49 -0700 IronPort-SDR: DQPPF6rGGoypw7fl+mxb1QdqEVAcpEJ+NJVYlFUGPrctamjFwPDh0x+LfRyxYR0TfYpw1cccPh N8faF+c9jVfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,341,1583222400"; d="scan'208";a="460372437" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.28.52]) by fmsmga006.fm.intel.com with ESMTP; 01 May 2020 13:39:49 -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/2] EdkRepo: Remove duplicate definition of generate_name_for_obsolete_backup Date: Fri, 1 May 2020 13:39:45 -0700 Message-Id: <20200501203946.17620-2-ashley.e.desimone@intel.com> In-Reply-To: <20200501203946.17620-1-ashley.e.desimone@intel.com> References: <20200501203946.17620-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: 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: 9JS7RbWuEnLU5bprzsKTSeI1x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588365593; bh=ALWHRQ7j4UjXmZJV9IuOVqFK/A88ei1HOVPHtR25Iac=; h=Cc:Date:From:Reply-To:Subject:To; b=WWUwcd3So9dqhy8QYVBrpKByVWfokSaL1/N7dv442Rk2WzOv+Xden0xuKdjLg40w+Ul vVz0LjtTEWGJs+9zhxEid7dTtSQiFql4ObpEMXPOOPTykUEEsPWZkRbYVy5OJv9LB0m6M 5D1ViYaxN7CxcXzEwoI/4YyUKb9Fu3Er+MQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove the duplicate definition of generate_name_for_obsolete_backup from common_repo_functions.py and update imports to use the definition in workspace_maintenance.py 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 --- edkrepo/commands/sync_command.py | 3 ++- edkrepo/common/common_repo_functions.py | 21 --------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_comma= nd.py index cb9dc4b..82f5247 100644 --- a/edkrepo/commands/sync_command.py +++ b/edkrepo/commands/sync_command.py @@ -34,12 +34,13 @@ from edkrepo.common.humble import SYNC_REBASE_CALC_FAIL from edkrepo.common.pathfix import get_actual_path from edkrepo.common.common_repo_functions import pull_latest_manifest_repo= , clone_repos, sparse_checkout_enabled from edkrepo.common.common_repo_functions import reset_sparse_checkout, sp= arse_checkout, verify_manifest_data -from edkrepo.common.common_repo_functions import generate_name_for_obsolet= e_backup, checkout_repos, check_dirty_repos +from edkrepo.common.common_repo_functions import checkout_repos, check_dir= ty_repos from edkrepo.common.common_repo_functions import update_editor_config from edkrepo.common.common_repo_functions import update_repo_commit_templa= te, get_latest_sha from edkrepo.common.common_repo_functions import has_primary_repo_remote, = fetch_from_primary_repo, in_sync_with_primary from edkrepo.common.common_repo_functions import update_hooks, maintain_su= bmodules, combinations_in_manifest from edkrepo.common.common_repo_functions import write_included_config, re= move_included_config +from edkrepo.common.workspace_maintenance.workspace_maintenance import gen= erate_name_for_obsolete_backup from edkrepo.common.ui_functions import init_color_console from edkrepo.config.config_factory import get_workspace_path, get_workspac= e_manifest, get_edkrepo_global_data_directory from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index 2aa5f5f..a333489 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -393,27 +393,6 @@ def checkout_repos(verbose, override, repos_to_checkou= t, workspace_path, manifes if repo_to_checkout.enable_submodule: maintain_submodules(repo_to_checkout, repo, verbose) =20 - - -def generate_name_for_obsolete_backup(absolute_path): - if not os.path.exists(absolute_path): - raise ValueError("{} does not exist".format(absolute_path)) - original_name =3D os.path.basename(absolute_path) - dir_name =3D os.path.dirname(absolute_path) - unique_name =3D "" - unique_name_found =3D False - index =3D 1 - while not unique_name_found: - if index =3D=3D 1: - unique_name =3D "{}_old".format(original_name) - else: - unique_name =3D "{}_old{}".format(original_name, index) - if not os.path.exists(os.path.join(dir_name, unique_name)): - unique_name_found =3D True - index +=3D 1 - return unique_name - - def verify_manifest_data(global_manifest_directory, config, verbose=3DFals= e, verify_all=3DFalse, verify_proj=3DNone, verify_archived=3DFalse): # Validate the project individual project selected if verify_proj: --=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 (#58526): https://edk2.groups.io/g/devel/message/58526 Mute This Topic: https://groups.io/mt/73407243/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 Tue Apr 30 17:54:06 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+58527+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+58527+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588365593; cv=none; d=zohomail.com; s=zohoarc; b=YqplUfRa8mrHzida2CEwMnwrBazq9Ous4qvA1KWRDwUDJlYrFYJ69ye0HS8aUc2+u34sijAJ5xFP6N4VdeeBdcCB1RMJIbr3bwJPzMqumCoLebehURO3wQ/tjG5SzXc6Ps7aX82eoc8YDHwTm6f5LmF9yupXT3fCen002NeY/1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588365593; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=lD9TgJr5kYy8SGU9pu7N3ePiRVsvpzesWdRRaTHoMgk=; b=envk+fVnxcST/9XV+CXkVcn6hjeR/uxYi9zn6d4b9YRBi3ozrLvhXDU11DryQqozRxcSc62OZclA1zx2nSYZkQUkaBytYFF0mEIlzyB7rHm0jqc0YuT3g8ZLOCGVQD0yBDh12Sft2Y5KuGFdO9ep1JuiN+mPGrIZz1cuMrs6KAU= 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+58527+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 1588365593452958.4400206675432; Fri, 1 May 2020 13:39:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tOqFYY1788612xJfW7ygJTcI; Fri, 01 May 2020 13:39:53 -0700 X-Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.3649.1588365590739524866 for ; Fri, 01 May 2020 13:39:51 -0700 IronPort-SDR: oeiETYYDc2NOM9Ih15u0OGsnc1xCSbqsPu+9CjobqQQpgrepNHS6HL/bBZEFXE5yz5JmGTNHxo SBjnxy+gKVgA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2020 13:39:50 -0700 IronPort-SDR: 96GeDSXB9aBRqHQpYKyO7DY+kuzCXxG1J5OgEWguxZao/4SWvUqiWyVSz44rCTweXx0VGKmWV1 ph3Jr2IN8ksA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,341,1583222400"; d="scan'208";a="460372442" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.212.28.52]) by fmsmga006.fm.intel.com with ESMTP; 01 May 2020 13:39:49 -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/2] EdkRepo: Remove duplicate definitions of case_insensitive_single_match and case_insensitive_equal Date: Fri, 1 May 2020 13:39:46 -0700 Message-Id: <20200501203946.17620-3-ashley.e.desimone@intel.com> In-Reply-To: <20200501203946.17620-1-ashley.e.desimone@intel.com> References: <20200501203946.17620-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: 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: 71rRFg6okMJG3l96NytYzgvWx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588365593; bh=l+oWsFWrpf0akPUT4SRS2D6YqWeU7v2diQ4LAt/Kutw=; h=Cc:Date:From:Reply-To:Subject:To; b=w9SEdtCxVLq2GxCtfdH3rfZrFX1HO/kjtZkTnalfrk11XvDYJDkL3HrNTBlzhrT+/8l FyrcaBhSdiE9Xdk32ULZynrBUgY90XqWrzCSxHVgQipcHxNJmUUtI+JyNr4pt9+OHtSFT qamzMdfHG9HT3D6LxiHuqzM5SmtiOMbBEpU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove duplicate definitions of and update imports of case_insensitive_single_match and case_insensitive_equal to point to the definitions in workspace_maintenance.py 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 --- edkrepo/commands/clone_command.py | 3 ++- edkrepo/common/common_repo_functions.py | 14 +------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_com= mand.py index 701a853..cd65fe6 100644 --- a/edkrepo/commands/clone_command.py +++ b/edkrepo/commands/clone_command.py @@ -14,12 +14,13 @@ from edkrepo.commands.edkrepo_command import EdkrepoCom= mand from edkrepo.commands.edkrepo_command import SubmoduleSkipArgument import edkrepo.commands.arguments.clone_args as arguments from edkrepo.common.common_repo_functions import pull_latest_manifest_repo= , clone_repos, sparse_checkout, verify_manifest_data -from edkrepo.common.common_repo_functions import case_insensitive_single_m= atch, update_editor_config +from edkrepo.common.common_repo_functions import update_editor_config from edkrepo.common.common_repo_functions import write_included_config, wr= ite_conditional_include from edkrepo.common.common_repo_functions import find_project_in_index, co= mbinations_in_manifest from edkrepo.common.edkrepo_exception import EdkrepoInvalidParametersExcep= tion, EdkrepoManifestInvalidException from edkrepo.common.humble import CLONE_INVALID_WORKSPACE, CLONE_INVALID_P= ROJECT_ARG, CLONE_INVALID_COMBO_ARG from edkrepo.common.humble import SPARSE_CHECKOUT, CLONE_INVALID_LOCAL_ROO= TS +from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match from edkrepo_manifest_parser.edk_manifest import CiIndexXml, ManifestXml =20 =20 diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index a333489..485aa26 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -60,6 +60,7 @@ from edkrepo.common.edkrepo_exception import EdkrepoNotFo= undException, EdkrepoGi from edkrepo.common.edkrepo_exception import EdkrepoFoundMultipleException= , EdkrepoHookNotFoundException from edkrepo.common.edkrepo_exception import EdkrepoGitConfigSetupExceptio= n, EdkrepoManifestInvalidException from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_single_manifest_repo +from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match from edkrepo.common.ui_functions import init_color_console from edkrepo_manifest_parser import edk_manifest from edkrepo_manifest_parser.edk_manifest_validation import validate_manif= estrepo @@ -571,19 +572,6 @@ def checkout(combination_or_sha, verbose=3DFalse, over= ride=3DFalse, log=3DNone): print(SPARSE_CHECKOUT) sparse_checkout(workspace_path, current_repos, manifest) =20 - -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] - def get_latest_sha(repo, branch, remote_or_url=3D'origin'): try: (latest_sha, ref) =3D repo.git.ls_remote(remote_or_url, 'refs/head= s/{}'.format(branch)).split() --=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 (#58527): https://edk2.groups.io/g/devel/message/58527 Mute This Topic: https://groups.io/mt/73407244/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-