From 18143c322614c6e81648b696d30e743068c24afa Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 9 Jan 2009 20:28:30 +0000 Subject: 262727: add $ZSH_PATCHLEVEL from ChangeLog revision --- Src/params.c | 2 ++ Src/zsh.mdd | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'Src') diff --git a/Src/params.c b/Src/params.c index 1a826bff4..89ab76bbf 100644 --- a/Src/params.c +++ b/Src/params.c @@ -31,6 +31,7 @@ #include "params.pro" #include "version.h" +#include "patchlevel.h" /* what level of localness we are at */ @@ -748,6 +749,7 @@ createparamtable(void) setsparam("VENDOR", ztrdup(VENDOR)); setsparam("ZSH_NAME", ztrdup(zsh_name)); setsparam("ZSH_VERSION", ztrdup(ZSH_VERSION)); + setsparam("ZSH_PATCHLEVEL", ztrdup(ZSH_PATCHLEVEL)); setaparam("signals", sigptr = zalloc((SIGCOUNT+4) * sizeof(char *))); for (t = sigs; (*sigptr++ = ztrdup(*t++)); ); diff --git a/Src/zsh.mdd b/Src/zsh.mdd index 1cba4b9dc..0d80b9259 100644 --- a/Src/zsh.mdd +++ b/Src/zsh.mdd @@ -33,12 +33,21 @@ init.o: bltinmods.list zshpaths.h zshxmods.h init.o params.o parse.o: version.h +params.o: patchlevel.h + # The main shell doesn't currently need zshcurses.h and zshterm.h, # but make sure these are built with the headers. # If it did need need them they would be in headers at the top instead. version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h echo '#define ZSH_VERSION "'$(VERSION)'"' > $@ +patchlevel.h: $(sdir_top)/ChangeLog + { \ + echo -n "#define ZSH_PATCHLEVEL "; \ + sed -ne 's/^\* *\$$Revision: 1.19 $$/"\1"/p' \ + $(sdir_top)/ChangeLog; \ + } >patchlevel.h + zshcurses.h: ../config.h @if test x$(ZSH_CURSES_H) != x; then \ echo "#include <$(ZSH_CURSES_H)>" >zshcurses.h; \ -- cgit 1.4.1