From nobody Thu May 2 16:35:38 2024 Delivered-To: importer@patchew.org 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+52851+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1578228093851935.8327412334501; Sun, 5 Jan 2020 04:41:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id U4WjYY1788612xKJ41DpGRhf; Sun, 05 Jan 2020 04:41:33 -0800 X-Received: from EUR03-DB5-obe.outbound.protection.outlook.com (EUR03-DB5-obe.outbound.protection.outlook.com [40.107.4.60]) by mx.groups.io with SMTP id smtpd.web10.18381.1578228091648524936 for ; Sun, 05 Jan 2020 04:41:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cdc2bb9AsYi/JDJzbgmlky+AqVgitaQXuko86kogXSx2HI1cjXlw1K7MMH+sFbu1AFqDvShjgRTShuJpRLbfkzIzJPHjT59KHl3/Mrr+AwU8XHrUQRRLQuo+0gFHe2p5rFaDpn7CTzOWgr9kZpjF9bz4CinZDBWxsnz/8Z3UezIGwfjNWOH87xnpT9i0d1ZL3fhKmvxbug3QoBHSqhaHGfApLWOWv9TOj0sYukVivy+1TeYBbQXG4L04fmV01Jia0kZXD8GtCPAglA5ParbmwfBRsh4bVwnYCzJCKuSCoy1Ncoy44BZ8foKgczF76Lv2IvFxaPQc4KSRWTkafJouVw== 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=e9xyBZo/1T+NxN6n6cQuuPnLbcaucSe0UBkg9cSud50=; b=HoE9BWoXQSFHFwmPndQrKy/sRGEQ+olaVexY063CngkNQcldY+AkRoYl2YF0OYvVNsxiaTaLJiYUgJDsraTnA/h5Qw2aiFdN4+DSp+Ze5moFvpFcZJ06O5Ll0Fk+IBk3s5+foOrTa9Apr21g4uALQeTryvl2IQ344XwTFuKAMspsTe7t2CO1ZizrIWiAoDGhhokcv6pA6z+CrFRcxZfrXqTl6RhiaKPU2XBOa+iTh2e1QfW5sZ8YJTWVVJRqxM7Q0h62MPYOCRv79l5W1+ooMebcOXvT6rRu3h3f/fotqFE/xEt42DuhRYONbs+rcb4M/dvoJJZzyqOtG3J739ZOTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2574.eurprd04.prod.outlook.com (10.168.65.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.15; Sun, 5 Jan 2020 12:41:29 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::8823:663d:c6ed:cbd6]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::8823:663d:c6ed:cbd6%12]) with mapi id 15.20.2602.015; Sun, 5 Jan 2020 12:41:29 +0000 X-Received: from uefi-workstation.ap.freescale.net (92.120.1.69) by TYCPR01CA0003.jpnprd01.prod.outlook.com (2603:1096:405::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10 via Frontend Transport; Sun, 5 Jan 2020 12:41:26 +0000 From: "Pankaj Bansal" To: "devel@edk2.groups.io" CC: Pankaj Bansal , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH] BaseTools: Retrieve git version info Thread-Topic: [PATCH] BaseTools: Retrieve git version info Thread-Index: AQHVw8Vzig5G4ZSN1UqM8VvoF9LNoA== Date: Sun, 5 Jan 2020 12:41:29 +0000 Message-ID: <20200105180132.23306-1-pankaj.bansal@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYCPR01CA0003.jpnprd01.prod.outlook.com (2603:1096:405::15) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c14cd645-944a-47f6-1121-08d791dc95d4 x-ms-traffictypediagnostic: VI1PR0401MB2574:|VI1PR0401MB2574: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:626; 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+52851+1787277+3901457@groups.io; helo=web01.groups.io; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: sneBmb1X7J1/j22jVuFpL81N8OT68JpS0g7QmioJC19Q6uBF420yElpB7vAQzlevhNa2dCM64ppXWpcVbGuxdKKc5svLeCsPRw1V46tXfXs6qFJn5k5AenVJqY5d97h9KBEFdYx5RqEsDRbHgcIRpCW5VwKeJwNfmEpMSmPizUXAsHObnq4X/S+fNk8PINS1n+JBzweROXyf4sy0J6HYtf3WkrfaSl8VeDwKYtn4CdxL7y3p2nytn9N9jhKTegB6v55wKbmyOVLLTBR8QgCLk2SIb7wKtc9smzAO07ItvMagxb5FcchpPm8YTMwOKBYIX4H579IybOkeAaoenb81IuSxh0aHsX0dmpfzltPk9YJGIA/ZM7P5LjARYMLP3eUxc5ooX8j9e8rghw17102+iJ/JpsalMYxCE/6iAkfMoqrmXbAMddqrnjLDWHMQTx0Rf3HpQqKkhgLULL50wLs3tLFXO0MO4ahbqA4AS0GnuLg= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c14cd645-944a-47f6-1121-08d791dc95d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2020 12:41:29.1569 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iEzojXWs5lASe8At2hSct7FHwELqilNie4R1mE1XwZDOT/yN95ccVgl+bUd7sU38HcuGx3VPBxs+hUME103Kow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2574 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,pankaj.bansal@nxp.com X-Gm-Message-State: 4jIMDZBG7LJEq3tQluuoY4Yex1787277AA= Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1578228093; bh=I+Vh71CsEjVnafVlVkp3MPd2J9b98rZyQ51NIjKX1uM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=DmSmX7OjNJ6fnlTDwzAHNZloPDO/+LByOLWaY0Dj/k9o/Zmf/OAgIsdartCbX1PNtBF QdS+f56uR9ToHlSCoZdpdCE6OUZdXAX6ucX6QZ+lXu2wWRvtMtDxgF92lSQ8s1USjQKm+ sTYoW3i2Y/gwqldp0UFDgyg9ogLG7+EvudI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Retrieve git version info and save as environment variable These variables can be used in modules to print the vesrion info when uefi boots. This helps in identifying the codebase from logs. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Pankaj Bansal --- Notes: When i ran PatchCheck.py script on this patch i received two errors: 1. Line ending ('\n') is not CRLF 2. The commit message format is not valid: * Contributed-under! (Note: this must be removed by the code contribut= or!) =20 I have fixed the [2] but i have not fixed [1], as this file's line endi= ngs are already unix like. Please suggest if i need to change these to wind= ows like? BaseTools/BinWrappers/PosixLike/build | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/BaseTools/BinWrappers/PosixLike/build b/BaseTools/BinWrappers/= PosixLike/build index f3770eed42..f32796db5d 100755 --- a/BaseTools/BinWrappers/PosixLike/build +++ b/BaseTools/BinWrappers/PosixLike/build @@ -10,5 +10,23 @@ full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooled= ge.org/BashFAQ/028 for a d dir=3D$(dirname "$full_cmd") cmd=3D${full_cmd##*/} =20 +git_version() +{ + command -v git>/dev/null 2>&1 + if [ $? -eq 0 ] && [ -n "$1" ] + then + head_or_tag=3D`git -C $1 describe --always 2>/dev/null` + printf $head_or_tag + git -C $1 diff-index --ignore-submodules --exit-code HEAD>/dev/null + if [ $? -eq 1 ]; then + printf '%s' -dirty + fi + else + printf "unknown" + fi +} + +export WORKSPACE_GIT_VERSION=3D$(git_version $WORKSPACE) +export PACKAGES_PATH_GIT_VERSION=3D$(git_version $PACKAGES_PATH) export PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@" --=20 2.17.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 (#52851): https://edk2.groups.io/g/devel/message/52851 Mute This Topic: https://groups.io/mt/69437290/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-