From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11188 invoked from network); 3 Sep 2021 17:38:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Sep 2021 17:38:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630690708; b=R6AkzUQH3Aw97vR6mMeoF1hsGmjWCMb6f6SREasl9/RLotQpp0i/uZwYWM1zc1EHwmmGhpGRjp iabOheY+a+K3HpwBMl+IbZwMi3ZMHGZbHMzCG3v3LIqWan8PNzdlwOO8oj2rvAw1MXHt34K2O8 AFATVGZYDjvKIS0j0ZB4p/9nZSFtNTU3QVGGN+QYXbyNavbxmalSvaqoc2TK/ktkYbW2zdMoUs H60YJW2oOTeXaR7UT3j3v0d3EkDjsHsVI3w2UxaVJNjFgGrrkBQHFHpceLvuFncRjArWlDCHsS d+6Mkn+4Wj+Ec/tMNN1xJNSo8REgq9B604DXwBA8WrWOwQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (lxh-heta-043.node.capitar.com) smtp.remote-ip=159.69.137.90; dmarc=none header.from=opperschaap.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630690708; bh=Ahm5c66yrfHk9yhUn0hF5gGp/9eBHyrYzOIOEXpPvcs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Reply-To:Message-ID: Date:Subject:To:From:DKIM-Signature; b=OqkzfOpuKrU42AsOL7GmOYb6HI96ge/Bb8f70BRX7aDcsQyFzt0suhbIr/icILp17A6p5gxItH hBkc54dF95mpcx6wIW7EGUjHgzmjSinZKnSxJaDZxILRpbVKzpfk8j42HBzkbGcdg1Ev22mbXJ +WlrmIhrdStgqiLxqLWkfWI/u6nisTDy0LhkMgY4ZYoiMVMYX1V1b7FNS++bgcphlZhmyTOATR +N4JC+4Jv/VGUxsm2VyHegX5LAFzLFj5FTEHAMpIvnTNsh9FgdLvNGQTc5tEGJRNZTo2OfAv/a LFVx40gUcrR3fTGofxjCF4WFrylo4WjIAQjnAk+GbxBRnw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: MIME-Version:Reply-To:Message-Id:Date:Subject:To:From:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=BOIpAV1zI3x2VT+lCcBcvFey39GFEkkwmQ0LyeSaB+A=; b=SVrAX6dqUZXiyYsqP+8VHitH+N yVZtwmDYrNC/Ssu764kjg6Pg3xfZyWBl4MGVs5I1HKBin4TxWC1iCmPIatZGm1LM+qTBlEO/N9tCu tLV9Qa7GY182eMh5c7OreX2b8QGulfym3TOp/QHLm1y3KejlVWvBuSCdi8q89CaVJ8PIOatBNr46W g/8XAqx1LpnrGD6v730qgj14frQAR9DtwlXGqw1EItyRpCAfGdsMnCAlXVdkINRiUaOqerSimy3IS ZSvmWnmN7w0gmcs62FL9sl+/ISEcTh8FgB5KqNn9UKoDUJV5XUYQV1ZcrGlgT/+4ngdLYqWYm+9tC FF92Eftw==; Received: from authenticated user by zero.zsh.org with local id 1mMD91-000Ej8-P9; Fri, 03 Sep 2021 17:38:27 +0000 Authentication-Results: zsh.org; iprev=pass (lxh-heta-043.node.capitar.com) smtp.remote-ip=159.69.137.90; dmarc=none header.from=opperschaap.net; arc=none Received: from lxh-heta-043.node.capitar.com ([159.69.137.90]:45094) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1mMD8o-000EQ6-NX; Fri, 03 Sep 2021 17:38:15 +0000 Received: from lxh-heta-043.node.capitar.com (localhost [127.0.0.1]) by eur-mail-proxy-p02.zt.capitar.com (Postfix) with ESMTPS id 680B420076 for ; Fri, 3 Sep 2021 19:38:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eur-mail-proxy-p02.zt.capitar.com (Postfix) with ESMTP id 8DEFF201A5 for ; Fri, 3 Sep 2021 19:38:12 +0200 (CEST) Received: from lxh-heta-043.node.capitar.com ([127.0.0.1]) by localhost (eur-mail-proxy-p02.zt.capitar.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XJF9CQz1nmzf for ; Fri, 3 Sep 2021 19:38:12 +0200 (CEST) Received: from neptune.setarnet.aw (unknown [186.189.145.201]) by eur-mail-proxy-p02.zt.capitar.com (Postfix) with ESMTPSA id 79C4F20075 for ; Fri, 3 Sep 2021 19:38:11 +0200 (CEST) From: Wesley Schwengle To: zsh-workers@zsh.org Subject: [PATCH] Show patchlevel in version string Date: Fri, 3 Sep 2021 13:38:03 -0400 Message-Id: <20210903173803.4005670-1-wesley@opperschaap.net> X-Mailer: git-send-email 2.33.0.113.g6c40894d24 Reply-To: wesley@opndev.io MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=R6R95uZX c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=NgX6OPfPqt74TpVTvcPRng==:17 a=7QKq2e-ADPsA:10 a=N3miCFJ7AAAA:8 a=Mf3SVPVTjVY_V2mzT1EA:9 a=V5H4rQgsk92nlYCD-KPC:22 X-Seq: 49374 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: When building zsh with a custom patch level you cannot quickly see which patchlevel you are on via `zsh --version'. When using zsh on Debian or in my case, where I run the git version of zsh the patch level is hidden in an environment variable ZSH_PATCHLEVEL. Git for example shows you the git revision when issues `git --version' as seen here: $ git --version git version 2.33.0.113.g6c40894d24 This shows directly what version a user is running without having to know about ZSH_PATCHLEVEL. Because I'm not aware how downstream deals with a difference in version strings I've decided to add it to the vendor/os type bit. Debian for example uses `debian/5.8-6+b2' as a patch level. This would probably break scripts which expect `zsh x.y.z' if the patch level replaced the ZSH_VERSION string. After this patch is applied, you get to see the following version string after you configured zsh with `--enable-custom-patchlevel=3D$(git describ= e)': $ ./Src/zsh --version zsh 5.8.0.2-dev (x86_64-pc-linux-gnu/zsh-5.8-481-g64befeb4c) Signed-off-by: Wesley Schwengle --- Src/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Src/init.c b/Src/init.c index 878a53a37..a04d599c3 100644 --- a/Src/init.c +++ b/Src/init.c @@ -421,8 +421,14 @@ parseopts(char *nam, char ***argvp, char *new_opts, = char **cmdp, /* GNU-style long options */ ++*argv; if (!strcmp(*argv, "version")) { +#ifdef CUSTOM_PATCHLEVEL + printf("zsh %s (%s-%s-%s/%s)\n", + ZSH_VERSION, MACHTYPE, VENDOR, OSTYPE, CUSTOM_PATCHLEVEL); +#else printf("zsh %s (%s-%s-%s)\n", ZSH_VERSION, MACHTYPE, VENDOR, OSTYPE); +#endif + LAST_OPTION(0); } if (!strcmp(*argv, "help")) { --=20 2.33.0.113.g6c40894d24