From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.1094.1602197816284945672 for ; Thu, 08 Oct 2020 15:56:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=wK3CZFdY; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: zECe3tePuojsuRPtms0a0R/ND/fUsfg8hTIN5FsNqGtveRRhIu658qVAnCwqzR79isoQq68sFS jv6p/vl0MNtQ== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="152336098" X-IronPort-AV: E=Sophos;i="5.77,352,1596524400"; d="scan'208";a="152336098" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 15:56:55 -0700 IronPort-SDR: dtaUsLtNsgRnVTia4mNbDjW7VS/RpyR9ymWW9aH1c9ZA/KmrJiLJzZ0RRcbml/2+wfBTa0yV3G k9JtsumwON+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,352,1596524400"; d="scan'208";a="298090529" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 08 Oct 2020 15:56:52 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 8 Oct 2020 15:56:50 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 8 Oct 2020 15:56:50 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.52) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 8 Oct 2020 15:56:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H8SRmOronyNYEMhOYToKVPtYyG845qFzfAeC0ymd8mam2l4wm5jGMcbXOvteJLnBdItqVCMm/vIvIVNaE+uH5o0oMq626SPH3AERxL9pCEoWFi7JnWZyJul4bMnoK1Hu9iX2qvZAe/yVuWa3kKmqTO5Xfj3x9dk1uDek/okdzRnnnv4sVnBVgcg00S0W35c4JnCpfMVI/Y+5xvNCvkL/0fHuu0PRpfdrh/3Ync4v8WLsEl3zOgF21AJ33Pyw8S80ewmj+qky5gsWDpYiOiw0Bkp7VdpPv3yZ5grXHX4yxcO877A/GVd07VJXOZ5yzZCL7FWHJpR9Jn0gJpRmF6KrXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=maDy3ermr5owIqA/+e/XxWZPV/cx5ZJ0P+6GTSKW0t0=; b=ao64HluHQooGeXauGpKUVokW+7oQKn4sOhZeCwgI9LZWtrp8HDTC21mCDQ2bYNf9pHTaeoKZ8vQO2oWlyoJk3i38nPTtsHP1kd+C3OKpR7RTQGqff4OfmrEY8rjTF9c7ilWV6Y2uX/vOgFF+55d2Jl4cljMfrHw/6Z7B73ZMyRQeU87KmkXv77liIbjzxWYlr7jMA4L93DTJZGW1k2gB4Jetm6A5WnAdoDmVYi0NcSmot3LZCuifQSPl0fPGQ6ceftKFClKfFHoD1bqWpAokwST8OxdXTsjW2DVVSaFWQ+TQJNS81Jcgu5ZxxOdWkoAp9IlJrv8BB+HtfKBSdsHJEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=maDy3ermr5owIqA/+e/XxWZPV/cx5ZJ0P+6GTSKW0t0=; b=wK3CZFdYAEg2lU9kscz9utWnWlfE7d0YloBRKk4tCEaC1lsfgUM4H0N39SoW/TClPmjpr/EXCj8QmnS+Bbfi+u7NyYW9zdndyrF0efrtHahELERIwahvBSNRtuzVAdkR4Cb3niuGVh6/adtC536up74I/wSp1Hi8ojMIdFN4tqc= Received: from BY5PR11MB3973.namprd11.prod.outlook.com (2603:10b6:a03:185::29) by BYAPR11MB2535.namprd11.prod.outlook.com (2603:10b6:a02:be::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Thu, 8 Oct 2020 22:56:48 +0000 Received: from BY5PR11MB3973.namprd11.prod.outlook.com ([fe80::e467:ac20:6b35:aa8c]) by BY5PR11MB3973.namprd11.prod.outlook.com ([fe80::e467:ac20:6b35:aa8c%5]) with mapi id 15.20.3455.022; Thu, 8 Oct 2020 22:56:48 +0000 From: "Ashley E Desimone" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Pandya, Puja" , Bret Barkelew , "Agyeman, Prince" , "Bjorge, Erik C" Subject: Re: [edk2-staging/EdkRepo] [PATCH V3 2/2] EdkRepo: Add support for subst drives Thread-Topic: [edk2-staging/EdkRepo] [PATCH V3 2/2] EdkRepo: Add support for subst drives Thread-Index: AQHWk6RotUNbLITe3kmvncY2gW/rOamOZUAA Date: Thu, 8 Oct 2020 22:56:48 +0000 Message-ID: References: <20200926012826.4976-1-nathaniel.l.desimone@intel.com> <20200926012826.4976-3-nathaniel.l.desimone@intel.com> In-Reply-To: <20200926012826.4976-3-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 29a8df86-f150-460d-575e-08d86bdd7027 x-ms-traffictypediagnostic: BYAPR11MB2535: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dCUMIc6GRiZB61EsYhifAeJckLmI5NWXIhYG3wlKro+ZS2wbLdTe6sBZ+7wxATn3L4OEquXuOio9FWkH9XST+pXdS6LjlvC8y748kGGHfhk8tiwy4ehU4CKGce83aRLh9GaJDr2bu1JkJBBoE3OcSLW/vITAq5cm35lBSxjg/Rw6SlJj4Uc6EVBtLim8nuCC4us2Ez0ZO38w6Ayvtz5f//NHws69cvw94qDF62elNuwUyyelIFY83kx+CwkT91peFi2aB6ei1dyWj8cWjjzWynraZHTR86dSOwzuu5XenpEicpHh27sHYohctyZVn5oa x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB3973.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(346002)(376002)(136003)(366004)(39860400002)(107886003)(55016002)(76116006)(66556008)(66476007)(66946007)(8936002)(64756008)(66446008)(53546011)(478600001)(4326008)(33656002)(6506007)(7696005)(86362001)(52536014)(9686003)(2906002)(83380400001)(5660300002)(8676002)(71200400001)(186003)(316002)(54906003)(110136005)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: o56LdFfiUwbckHclsMdQX/zrIcqiIIyzV/H3aHfBYSeMf2aH85GD0Mr7xTqEgWwwdkx9SWjUu0gNwGcqDJATPbFoU0Lx5D4zjnxFIvaU+i+5XK1gasn+BeGuVJtIJ9zSkghA42y/jvcUD39v7Vs+FTv+KDLJOAvq2yrWzZK7Osi8jO9yusFTLkKWHfiRQdTMT5nL1HjJ12w1RVA0Yq1iNCs+i9eV5FwCuIiGT2wvKs9IeXmxQ2wgeGFbCEGRoHSuwdRGxGsfiNezF9nKziK1OqXF/zo7XmKrQbgwZRXMsHSobwignYprCrfOkTrqt6fnyPh/J125ZHkGQrhz2xQxXk5NQixpo2+NUWLBKby+Gc077xjBHiZEwbqOkd6e4SPbG672QhBv2cy8p5r0/7Hh3gtYK8ueQ+8zV2hReRXN694/nTwmci/L1boFh0z8CJnRPpmo5tr2PRIkhNZUrMviiMa+kBIIaledg3bavZbTylD1BGpIw124RBua5d5aENZJ0RWJjdw/GnDXlCUtSntgrtN+uLL3s988VfHoImCuAvrthhXUYnx8LL4riXcoZ8Z5KJX1iYYigBqKcl9tJyBxe34y7eEMXZTurOYCJkjV5rcIulQHxHle8qhgeDHp8PRkVKIClW2//ujpIZ2If6HGKw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB3973.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a8df86-f150-460d-575e-08d86bdd7027 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2020 22:56:48.4617 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: f9+DhEeaQqaF5zKMLwu530v9q3u5SL3RdqYxeGJwk4/yN+DSiVW8/hwZHIndYvfuUsrgIQNmmH096ItDK0FUgUcNWYGMYVzbb0cOMzIwxcU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2535 Return-Path: ashley.e.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ashley DeSimone -----Original Message----- From: Nate DeSimone =20 Sent: Friday, September 25, 2020 6:28 PM To: devel@edk2.groups.io Cc: Desimone, Ashley E ; Pandya, Puja ; Bret Barkelew ; Agyeman, Prin= ce ; Bjorge, Erik C Subject: [edk2-staging/EdkRepo] [PATCH V3 2/2] EdkRepo: Add support for sub= st drives get_workspace_path() now converts a virtual drive path to a real path befor= e any git repo operations are done. Cc: Ashley E Desimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Nate DeSimone --- edkrepo/commands/clone_command.py | 8 ++++++++ edkrepo/config/config_fac= tory.py | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_com= mand.py index f638090..8769102 100644 --- a/edkrepo/commands/clone_command.py +++ b/edkrepo/commands/clone_command.py @@ -9,6 +9,7 @@ =20 import os import shutil +import sys =20 from edkrepo.commands.edkrepo_command import EdkrepoCommand from edkrepo.= commands.edkrepo_command import SubmoduleSkipArgument, SourceManifestRepoAr= gument @@ -20,6 +21,7 @@ from edkrepo.common.edkrepo_exception import Edkre= poInvalidParametersException, from edkrepo.common.edkrepo_exception import EdkrepoManifestNotFoundExcept= ion from edkrepo.common.humble import CLONE_INVALID_WORKSPACE, CLONE_INVAL= ID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG from edkrepo.common.humble import = SPARSE_CHECKOUT, CLONE_INVALID_LOCAL_ROOTS +from edkrepo.common.pathfix import get_subst_drive_dict from edkrepo.common.workspace_maintenance.workspace_maintenance import cas= e_insensitive_single_match from edkrepo.common.workspace_maintenance.manif= est_repos_maintenance import pull_all_manifest_repos, find_project_in_all_i= ndices from edkrepo.common.workspace_maintenance.manifest_repos_maintenanc= e import list_available_manifest_repos @@ -77,6 +79,12 @@ class CloneComman= d(EdkrepoCommand): workspace_dir =3D os.getcwd() else: workspace_dir =3D os.path.abspath(workspace_dir) + if sys.platform =3D=3D "win32": + subst =3D get_subst_drive_dict() + drive =3D os.path.splitdrive(workspace_dir)[0][0].upper() + if drive in subst: + 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..fe69460 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 EdkrepoGlobalConfigNotFoundException, Edkr= epoConfigFileInvalidException from edkrepo.common.edkrepo_exception import= EdkrepoWorkspaceInvalidException, EdkrepoGlobalDataDirectoryNotFoundExcept= ion 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_dict from edkrepo_manifest_parser import edk_manifest from edkrepo.common.path= fix 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_dict() + drive =3D os.path.splitdrive(path)[0][0].upper() + if drive in subst: + path =3D os.path.join(subst[drive],=20 + os.path.splitdrive(path)[1][1:]) return path if os.path.dirname(path) =3D=3D path: break -- 2.27.0.windows.1