Move the version string out of configure.ac.

This commit is contained in:
Wayne Davison committed 2020-06-28 15:02:19 -07:00
1 parent 76064b1bf2
commit 3b4f5fb891
6 files changed
+23 -21

No files matched your search

+5 -8
View File
@@ -1,5 +1,4 @@
# Makefile for rsync. This is processed by configure to produce the final
# Makefile
# The input file that configure uses to create the Makefile for rsync.
prefix=@prefix@
datarootdir=@datarootdir@
@@ -27,8 +26,6 @@ MKDIR_P=@MKDIR_P@
VPATH=$(srcdir)
SHELL=/bin/sh
VERSION=@RSYNC_VERSION@
.SUFFIXES:
.SUFFIXES: .c .o
@@ -38,7 +35,7 @@ ASM_x86_64=lib/md5-asm-x86_64.o
GENFILES=configure.sh aclocal.m4 config.h.in proto.h proto.h-tstamp rsync.1 rsync.1.html \
rsync-ssl.1 rsync-ssl.1.html rsyncd.conf.5 rsyncd.conf.5.html
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
lib/pool_alloc.h lib/mdigest.h lib/md-defines.h
lib/pool_alloc.h lib/mdigest.h lib/md-defines.h version.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
@@ -236,13 +233,13 @@ proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c config.h
.PHONY: man
man: rsync.1 rsync-ssl.1 rsyncd.conf.5
rsync.1: rsync.1.md md2man NEWS.md Makefile
rsync.1: rsync.1.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync.1.md
rsync-ssl.1: rsync-ssl.1.md md2man NEWS.md Makefile
rsync-ssl.1: rsync-ssl.1.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync-ssl.1.md
rsyncd.conf.5: rsyncd.conf.5.md md2man NEWS.md Makefile
rsyncd.conf.5: rsyncd.conf.5.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsyncd.conf.5.md
.PHONY: clean
+4 -5
View File
@@ -1,16 +1,15 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([rsync],[3.2.2pre1],[https://rsync.samba.org/bugtracking.html])
AC_INIT([rsync],[],[https://rsync.samba.org/bugtracking.html])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([byteorder.h])
AC_CONFIG_HEADER(config.h)
AC_PREREQ([2.69])
AC_SUBST(RSYNC_VERSION, $PACKAGE_VERSION)
AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
PACKAGE_VERSION=`sed 's/.*"\(.*\)".*/\1/' <$srcdir/version.h`
AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$PACKAGE_VERSION"], [rsync release version])
AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
LDFLAGS=${LDFLAGS-""}
@@ -1338,5 +1337,5 @@ AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
AC_OUTPUT
AC_MSG_RESULT()
AC_MSG_RESULT([ rsync ${RSYNC_VERSION} configuration successful])
AC_MSG_RESULT([ rsync $PACKAGE_VERSION configuration successful])
AC_MSG_RESULT()
+7 -2
View File
@@ -93,7 +93,7 @@ def main():
env_subs['VERSION'] = '1.0.0'
env_subs['libdir'] = '/usr'
else:
for fn in (fi.srcdir + 'NEWS.md', 'Makefile'):
for fn in (fi.srcdir + 'version.h', 'Makefile'):
try:
st = os.lstat(fn)
except:
@@ -101,6 +101,11 @@ def main():
if not fi.mtime:
fi.mtime = st.st_mtime
with open(fi.srcdir + 'version.h', 'r', encoding='utf-8') as fh:
txt = fh.read()
m = re.search(r'"(.+?)"', txt)
env_subs['VERSION'] = m.group(1)
with open('Makefile', 'r', encoding='utf-8') as fh:
for line in fh:
m = re.match(r'^(\w+)=(.+)', line)
@@ -112,7 +117,7 @@ def main():
while re.search(r'\$\{', val):
val = re.sub(r'\$\{(\w+)\}', lambda m: env_subs[m.group(1)], val)
env_subs[var] = val
if var == 'VERSION':
if var == 'srcdir':
break
with open(fi.fn, 'r', encoding='utf-8') as fh:
+5 -6
View File
@@ -153,7 +153,7 @@ release is "{release}"
About to:
- tweak SUBPROTOCOL_VERSION in rsync.h, if needed
- tweak the version in configure.ac and the spec files
- tweak the version in version.h and the spec files
- tweak NEWS.md to ensure header values are correct
- generate configure.sh, config.h.in, and proto.h
- page through the differences
@@ -168,16 +168,15 @@ About to:
'%define srcdir': srcdir,
}
tweak_files = 'configure.ac rsync.h NEWS.md'.split()
tweak_files = 'version.h rsync.h NEWS.md'.split()
tweak_files += glob.glob('packaging/*.spec')
tweak_files += glob.glob('packaging/*/*.spec')
for fn in tweak_files:
with open(fn, 'r', encoding='utf-8') as fh:
old_txt = txt = fh.read()
if 'configure' in fn:
x_re = re.compile(r'^(AC_INIT\(\[rsync\],\s*\[)\d.+?(\])', re.M)
txt = replace_or_die(x_re, r'\g<1>%s\2' % version, txt, f"Unable to update AC_INIT with version in {fn}")
if fn == 'version.h':
txt = f"#define RSYNC_VERSION {version}\n"
elif '.spec' in fn:
for var, val in specvars.items():
x_re = re.compile(r'^%s .*' % re.escape(var), re.M)
@@ -237,7 +236,7 @@ About to:
if s.returncode:
die('Aborting')
cmd_chk('make reconfigure ; make gen')
cmd_chk('make gen')
cmd_chk(['rsync', '-a', *gen_files, 'SaVeDiR/'])
print(f'Creating any missing patch branches.')
+1
View File
@@ -297,6 +297,7 @@ enum delret {
#include "errcode.h"
#include "config.h"
#include "version.h"
/* The default RSYNC_RSH is always set in config.h. */
+1
View File
@@ -0,0 +1 @@
#define RSYNC_VERSION "3.2.2pre1"