From nobody Sun Feb 8 11:06:00 2026 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+63773+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+63773+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1596692808; cv=none; d=zohomail.com; s=zohoarc; b=EswFTVv7bI6f8eUxfdAyJNJpqpCofs0mD14GJAM49UtrcC+iiDNkRuXxTSVad9krllipEObtpPmi17yJJoLU1kHJOKcZ8b/o745Dh3bT5xLjxtx5XfNhvtBNRmnAIXlFC6ifQNnvRoDoqehIGugUduJHzY1KW13pADD7S5tysO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596692808; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Rx5ZXIT+RTo609Du9CyXQezrK8i7dZYRJiJjKJPgMCU=; b=Y+w8Rw46Lykrx0ssajGj1xWAQhlhJnc0uIz/y+4wRqIGEqhySHcJI20M265jFlepU/LmqbqKSdGHrRs7YXZoGp3jxf4eKfasSZCLkkh2XVcXXmkC+bmagsxfsjEA/uBQzcNPxyAR1rq6+Y4TxdAZv0R7HBMdPND40DcYRAHKEFw= 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+63773+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 1596692808287634.8818258001271; Wed, 5 Aug 2020 22:46:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VskfYY1788612xaDYqvf0qF1; Wed, 05 Aug 2020 22:46:47 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.666.1596692806864284589 for ; Wed, 05 Aug 2020 22:46:47 -0700 IronPort-SDR: kV4WlA2slhiq/SNWxliQchfSFGL+HLrszOgfoyOL58mxbII9IkSObbfPbp+IY0MkOVW2s0xL/b mM4+//JxwSRw== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="150471449" X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="150471449" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2020 22:46:46 -0700 IronPort-SDR: wTpouIUbygB5aJZMVlzbJTK3fC5wsKzuhazDRcgNGW6NCi8c6OAzsdqeclmQ2Aw7+TSrKXfYgD JykO2i57S4hQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="276294505" X-Received: from nldesimo-desk1.amr.corp.intel.com ([10.212.84.141]) by fmsmga008.fm.intel.com with ESMTP; 05 Aug 2020 22:46:46 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley E Desimone , Puja Pandya , Bret Barkelew , Prince Agyeman , Erik Bjorge Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH V1 1/2] EdkRepo: Add function to enumerate subst drives Date: Wed, 5 Aug 2020 22:46:34 -0700 Message-Id: <20200806054635.4809-2-nathaniel.l.desimone@intel.com> In-Reply-To: <20200806054635.4809-1-nathaniel.l.desimone@intel.com> References: <20200806054635.4809-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 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,nathaniel.l.desimone@intel.com X-Gm-Message-State: lNT66NDVX51DpoFBn0DolaJhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596692807; bh=eNv0khhOH4CD048lNdUO/vOI6FVhGop7kIeqkaPtSzs=; h=Cc:Date:From:Reply-To:Subject:To; b=brM3DFMHPDpYnjDMKzWYWm5+pRAjVKLoTHrKMUvXJLsO0sGSx1BKpU/oUa4XnTMwYBJ QybXsrrqTAAs3YPXaV5mo7R6IRqUTiv3hw3rfDTs279Tu/+zwidqRKranC2ewkVZbx/f3 qHf/ybr/8PkNJ/ZUKa8+yE6GCLQkQgiAHF4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Nate DeSimone --- edkrepo/common/pathfix.py | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/edkrepo/common/pathfix.py b/edkrepo/common/pathfix.py index 1a9c20f..69ed1a4 100644 --- a/edkrepo/common/pathfix.py +++ b/edkrepo/common/pathfix.py @@ -3,7 +3,7 @@ ## @file # checkout_command.py # -# Copyright (c) 2018- 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # import os @@ -11,6 +11,7 @@ import sys if sys.platform =3D=3D "win32": from ctypes import windll, POINTER, byref, GetLastError, Structure, Wi= nError from ctypes import c_void_p, c_ushort, c_int, c_ulong, c_wchar, c_wch= ar_p + from ctypes import create_unicode_buffer =20 def _is_wow64_process(): kernel32 =3D windll.kernel32 @@ -211,3 +212,50 @@ def expanduser(path): userhome =3D os.path.join(os.path.dirname(userhome), path[1:i]) =20 return userhome + path[i:] + +def get_subst_drive_list(): + if sys.platform !=3D "win32": + return {} + def _query_subst_drive(drive_letter): + kernel32 =3D windll.kernel32 + QueryDosDevice =3D kernel32.QueryDosDeviceW + QueryDosDevice.argtypes =3D [c_wchar_p, c_wchar_p, c_ulong] + QueryDosDevice.restype =3D c_ulong + MAX_PATH =3D 260 + + if len(drive_letter) > 1 or len(drive_letter) =3D=3D 0: + raise ValueError("Bad drive letter") + drive =3D '{}:'.format(drive_letter.upper()) + drive_buffer =3D create_unicode_buffer(drive) + target_path_buffer_size =3D c_ulong(MAX_PATH) + target_path_buffer =3D create_unicode_buffer(target_path_buffer_si= ze.value) + while True: + count =3D QueryDosDevice(drive_buffer, target_path_buffer, tar= get_path_buffer_size) + if count =3D=3D 0: + last_error =3D GetLastError() + if last_error =3D=3D 122: #ERROR_INSUFFICIENT_BUFFER + #Increase the buffer size and try again + target_path_buffer_size =3D c_ulong((target_path_buffe= r_size.value * 161) / 100) + target_path_buffer =3D create_unicode_buffer(target_pa= th_buffer_size.value) + elif last_error =3D=3D 2: #ERROR_FILE_NOT_FOUND + #This is an invalid drive, return an empty string + return '' + else: + raise WinError(last_error) + else: + break + target_path =3D target_path_buffer.value + if len(target_path) > 4 and target_path[0:4] =3D=3D '\\??\\': + if (ord(target_path[4]) >=3D ord('A') and ord(target_path[4]) = <=3D ord('Z')) or \ + (ord(target_path[4]) >=3D ord('a') and ord(target_path[4])= <=3D ord('z')): + #This is a SUBST'd drive, return the path + return target_path[4:].strip() + #This is a non-SUBST'd (aka real) drive, return an empty string + return '' + subst_dict =3D {} + for index in range(26): + drive_letter =3D chr(ord('A') + index) + target_path =3D _query_subst_drive(drive_letter) + if target_path !=3D '': + subst_dict[drive_letter] =3D target_path + return subst_dict --=20 2.27.0.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 (#63773): https://edk2.groups.io/g/devel/message/63773 Mute This Topic: https://groups.io/mt/76022881/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 Sun Feb 8 11:06:00 2026 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+63774+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+63774+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1596692808; cv=none; d=zohomail.com; s=zohoarc; b=BEgZ/ZErfGSPLPsIH97DOtfa8jPeZx5C+OHWnBy2OTB1Ee8mfgkObzV0+jSAIUkSTNml/A0OcTkrx0d34WsByFymLIJDtUCt8GJ+rP/JBI4oh6YBWSdy1n5q9Uec73EIEYl1s1nu/zBea33Ucq6sDXkr3Kw+fcW8NOKYFGaJmYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596692808; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dpQZlskR6pPnGGKtgvPdKCNN2m2Aj+0DwZIGoIm67Cc=; b=fQFi0fnKgQCK7iTQGSLWQL1yybzZ7S96AOW/iBkDrAqfO9TbEar2EQ6q8I7GuLUmK3Pgwb2NKCI7vi6eYq9a9pdPOpUAFYLZvdhBILdU+BFUnWmk4hGd1YecaCMzIlM699EEED2Q5+WL7LYSZkI8tjF64mDowi6UGNvmKP8hy5E= 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+63774+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 1596692808831866.8161147579007; Wed, 5 Aug 2020 22:46:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IVerYY1788612xsN85C5Wo7f; Wed, 05 Aug 2020 22:46:48 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.666.1596692806864284589 for ; Wed, 05 Aug 2020 22:46:47 -0700 IronPort-SDR: 7O8FaxDuLxnwZAyQxJRHRdTj/zBdiqHG3zVtXgubEgSaX2mxvdmB1OEzJKEfXaa6wfCNv5323y Xz/dDtKcMlCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="150471450" X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="150471450" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2020 22:46:46 -0700 IronPort-SDR: WXdIbO95U2jxp3C6JzIxzRgVcBcy//gccNvhex4qd860VPhUa0u+fdhgRIfWk1PISaq0VUEE2i gTyTokm/qG4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="276294508" X-Received: from nldesimo-desk1.amr.corp.intel.com ([10.212.84.141]) by fmsmga008.fm.intel.com with ESMTP; 05 Aug 2020 22:46:46 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley E Desimone , Puja Pandya , Bret Barkelew , Prince Agyeman , Erik Bjorge Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH V1 2/2] EdkRepo: Add support for subst drives Date: Wed, 5 Aug 2020 22:46:35 -0700 Message-Id: <20200806054635.4809-3-nathaniel.l.desimone@intel.com> In-Reply-To: <20200806054635.4809-1-nathaniel.l.desimone@intel.com> References: <20200806054635.4809-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 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,nathaniel.l.desimone@intel.com X-Gm-Message-State: 3WLRyRoyFqMYzUPVu7cRS8gbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596692808; bh=/zOcH9C3zAuemy/1wYqPGizcluZRfHFiwyFgL7dqW94=; h=Cc:Date:From:Reply-To:Subject:To; b=udkQlVPQrG8H2hRJ6rgUbg8KRqoi6ghZ54DQeIHBAjVecj2eDbN2cWV+KwtumIHX3QS d1BHGDAWvpESRijv1Pd8JHcGf+azY+Xu/tfRi9w3tTU6bOKNRLSj8D097/02+/Af8LLot kyFDyfhzogSuj5obnBg1VmkxV6feY0NFN6U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" get_workspace_path() now converts a virtual drive path to a real path before any git repo operations are done. Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Nate DeSimone Reviewed-by: Ashley DeSimone --- edkrepo/commands/clone_command.py | 6 ++++++ edkrepo/config/config_factory.py | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_com= mand.py index f638090..650bc81 100644 --- a/edkrepo/commands/clone_command.py +++ b/edkrepo/commands/clone_command.py @@ -20,6 +20,7 @@ from edkrepo.common.edkrepo_exception import EdkrepoInval= idParametersException, from edkrepo.common.edkrepo_exception import EdkrepoManifestNotFoundExcept= ion 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.pathfix import get_subst_drive_list from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t pull_all_manifest_repos, find_project_in_all_indices from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t list_available_manifest_repos @@ -77,6 +78,11 @@ class CloneCommand(EdkrepoCommand): workspace_dir =3D os.getcwd() else: workspace_dir =3D os.path.abspath(workspace_dir) + subst =3D get_subst_drive_list() + for drive in subst.keys(): + if '{}:'.format(drive) =3D=3D os.path.splitdrive(workspace_dir= )[0].upper(): + workspace_dir =3D os.path.join(subst[drive], os.path.split= drive(workspace_dir)[1][1:]) + workspace_dir =3D os.path.normpath(workspace_dir) if os.path.isdir(workspace_dir) and os.listdir(workspace_dir): raise EdkrepoInvalidParametersException(CLONE_INVALID_WORKSPAC= E) if not os.path.isdir(workspace_dir): diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_facto= ry.py index a82a438..45ac16f 100644 --- a/edkrepo/config/config_factory.py +++ b/edkrepo/config/config_factory.py @@ -11,13 +11,16 @@ import os import sys import configparser import collections -from ctypes import * +if sys.platform =3D=3D "win32": + from ctypes import oledll, c_void_p, c_uint32, c_wchar_p + from ctypes import create_unicode_buffer =20 import edkrepo.config.humble.config_factory_humble as humble from edkrepo.common.edkrepo_exception import EdkrepoGlobalConfigNotFoundEx= ception, EdkrepoConfigFileInvalidException from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidExcept= ion, EdkrepoGlobalDataDirectoryNotFoundException from edkrepo.common.edkrepo_exception import EdkrepoConfigFileReadOnlyExce= ption from edkrepo.common.humble import MIRROR_PRIMARY_REPOS_MISSING, MIRROR_DEC= ODE_WARNING, MAX_PATCH_SET_INVALID +from edkrepo.common.pathfix import get_subst_drive_list from edkrepo_manifest_parser import edk_manifest from edkrepo.common.pathfix import expanduser =20 @@ -238,6 +241,11 @@ def get_workspace_path(): while True: if os.path.isdir(os.path.join(path, "repo")): if os.path.isfile(os.path.join(os.path.join(path, "repo"), "Ma= nifest.xml")): + if sys.platform =3D=3D "win32": + subst =3D get_subst_drive_list() + for drive in subst.keys(): + if '{}:'.format(drive) =3D=3D os.path.splitdrive(p= ath)[0].upper(): + path =3D os.path.join(subst[drive], os.path.sp= litdrive(path)[1][1:]) return path if os.path.dirname(path) =3D=3D path: break --=20 2.27.0.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 (#63774): https://edk2.groups.io/g/devel/message/63774 Mute This Topic: https://groups.io/mt/76022882/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-