Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Show patchlevel in version string
- X-seq: zsh-workers 50032
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: wesley@xxxxxxxxx
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Show patchlevel in version string
- Date: Sun, 10 Apr 2022 21:35:29 +0000
- Archived-at: <https://zsh.org/workers/50032>
- In-reply-to: <20210903173803.4005670-1-wesley@opperschaap.net>
- List-id: <zsh-workers.zsh.org>
- References: <20210903173803.4005670-1-wesley@opperschaap.net>
Wesley Schwengle wrote on Fri, Sep 03, 2021 at 13:38:03 -0400:
> After this patch is applied, you get to see the following version string
> after you configured zsh with `--enable-custom-patchlevel=$(git describe)':
>
> $ ./Src/zsh --version
> zsh 5.8.0.2-dev (x86_64-pc-linux-gnu/zsh-5.8-481-g64befeb4c)
Adding the git revision there makes sense, I suppose, but why should
this only be done when that configure option is used? The git revision
is added to ZSH_PATCHLEVEL (which is a shell variable, not an
environment variable) by default, without needing any configure flags.
Or another perspective: CUSTOM_PATCHLEVEL is used to cause
$ZSH_PATCHLEVEL to be set to something other than its default. So,
why shouldn't the #else branch emit the default value of $ZSH_PATCHLEVEL?
tl;dr: Why not include the (build's default) value of $ZSH_PATCHLEVEL in
the output?
Cheers,
Daniel
> Signed-off-by: Wesley Schwengle <wesley@xxxxxxxxxxxxxxx>
> ---
> 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")) {
> --
> 2.33.0.113.g6c40894d24
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author