From nobody Fri May 3 14:36:32 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+52060+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+52060+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1575936141; cv=none; d=zohomail.com; s=zohoarc; b=P5Tpz6ivbsMQkdBr/RfzreAkOC1DBFjuRVpACw5goc0uuzEvxlYdU9KM9U6r6Kxb0x/2Et5NoQ12zaka0uxOS87idSineel8Ey/x/Se1mmaeGU1FNRLMomXTKURh0a/D7J0uyMn08ifSXIE5raHLDOFeRhv/hrieRzeuF/7KC0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575936141; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=L4RI05shW4oLjSBUelEl+D9vVKoO3SfE1EjQD3JKe6A=; b=GcnYvZtXDgthLB73QYD6Z6M0UeS5ETIs/9r1AcTM3V7aD18TXUBq5q2NYWqupcC/yPnly9kVvwG0dFbi57zYJ69PsCXUj4/iej4jgkCaBlh+rbheLKAmvDYs5kFbOOv6EK4Neg6IH4fJq8TFpJNyfDs4ZeE+6z3LPThgF35WHxM= 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+52060+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 1575936141114844.8219693605781; Mon, 9 Dec 2019 16:02:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id FVkvYY1788612x5UkCuZgygb; Mon, 09 Dec 2019 16:02:20 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.3056.1575936138979471338 for ; Mon, 09 Dec 2019 16:02:19 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Dec 2019 16:02:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,297,1571727600"; d="scan'208";a="210243589" X-Received: from nldesimo-mac02.jf.intel.com ([10.24.15.92]) by fmsmga007.fm.intel.com with ESMTP; 09 Dec 2019 16:02:17 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ashley E Desimone , Puja Pandya , Nathaniel L Desimone Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: EdkRepo fails to run in detached HEAD mode Date: Mon, 9 Dec 2019 16:02:07 -0800 Message-Id: <20191210000207.62998-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: ftiTfDpoCv5vQ1gewUIFc3umx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1575936140; bh=bPgSOI+JcfNEiPHf/X7nzxzhTYnokyE5m6nviA5q728=; h=Cc:Date:From:Reply-To:Subject:To; b=jCw3EuC2GhNCMQokjQjUcn1yiOSAbTNksXzw/98Hv+96zkb1wABP+eIYHBXOO4P/dn2 EfnTz+s8WxhwZIx6zPRqarwQrGMHLHrelj2VhMOaM6CtWteUO1czBalIILQTfjOcO797+ AaZdHkEhSuYeT4O1XZ6aGbfpjGDy31qCGzI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" If the current working directory is a git repo, then the EdkRepo entrypoint will fail to execute. This is caused by the command_factory being overzealous while searching for commands and constructing GitPython objects and searching those objects for EdkRepo commands. Cc: Ashley E Desimone Cc: Puja Pandya Signed-off-by: Nathaniel L Desimone --- edkrepo/commands/command_factory.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/edkrepo/commands/command_factory.py b/edkrepo/commands/command= _factory.py index 9f2e923..b607724 100644 --- a/edkrepo/commands/command_factory.py +++ b/edkrepo/commands/command_factory.py @@ -61,9 +61,16 @@ def get_commands(): if module =3D=3D '__init__.py' or os.path.splitext(module)[1] = !=3D '.py': continue mod =3D importlib.import_module('{}.{}'.format(cmd_dir[0], os.= path.splitext(module)[0])) + mod_path =3D os.path.normcase(os.path.normpath(inspect.getfile= (mod))) classes =3D inspect.getmembers(mod, predicate=3Dinspect.isclas= s) for cls in classes: - if _is_command(cls[1]): + in_same_module =3D False + try: + if mod_path =3D=3D os.path.normcase(os.path.normpath(i= nspect.getfile(cls[1]))): + in_same_module =3D True + except TypeError: + pass + if in_same_module and _is_command(cls[1]): if cmd_dir[0] =3D=3D pref_cmd_pkg: pref_commands.update([(cls[0], cls[1])]) else: --=20 2.20.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 (#52060): https://edk2.groups.io/g/devel/message/52060 Mute This Topic: https://groups.io/mt/67921384/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-